Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Form in Expression Builder? 2

Status
Not open for further replies.

Fazee

Technical User
Feb 12, 2004
10
GB
I have a form whereby a user clicks on a field and depending on the value of the timeofday field it opens either one form or another.

i know what i want but don't know how and where to implement it.

i.e IIF([timeofday]="allday",openform1,openform2)

can this be done in expression builder, if so what commands would i use to open a form?

Thanks in advanced
 
Take a look at the DoCmd.OpenForm method

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Don't think so, I think you'll have to use an event, either the on click event of the text control you're mentioning, create a button or..., then something like this in the event procedure:

[tt]if me("timeofday").value = "allday" then
docmd.openform "form1"
else
docmd.openform "form2"
end if[/tt]

- assuming "timeofday" is a control on your current form

- on the event you'll decide to use, use the buttons with three dots at the right, select code builder and enter the above code. Alter the names of the forms to the names of forms you have in your database.

BTW - check out the forms forum (forum702) on form related questions (and keyword search relating to forms).

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top