In a procedure, is it possible to set a combo box to a default item 0? If so how? The property sheet default value can not be used for this. Thanks to anyone who responses.
Thanks for responding. But no I can't use the Default Value, because I want it to remain blank most of the time. I do have an After Update procedure:
Private Sub WorkDay1_AfterUpdate()
DoCmd.GoToControl "WorkDay1Reason"
End Sub
I was hope to get it to run here, because this is the only time that I will need it. I guess you need to see the form "running" to understand it. Basicaly when I make a change to WorkDay1, which is a text box, I want to go to WorkDay1Reason, which is a combo box. I would like the default like this, because these are the two most likely settings:
If WorkDay1 = 0 Then
WorkDay1Reason.ItemData(0)
Else
WorkDay1Reason.ItemData(6)
I have tried all afternoon to get the if into the above procedure, but so far nothing but error, error, error everywhere. I have looked in every help thing I can find, but nothing is helping. Thanks again for the response.
I don't think it like that. I get the following error message:
"The expression On Current you entered as the event property setting produced the followinf error:Ambiguous name detected:WorkDay1_AfterUpdate."
Now I do have a procedure in Form_Current which is simply:
Private Sub Form_Current()
WorkDay1.SetFocus
End Sub
I don't see how that could effect it. Any thoughts? Thanks for the quick response.
I found it and now it is working. I had somehow pasted that first line on something much further down the list and way out of site. Thanks for all of the help.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.