Question : Open a form and populate an unbound field on the form being opened

Hi experts,

I would like to open a form and automatically populate an unbound field that is on this opened form.  Is it possible to do this in one line of code using the docmd.openform method?

I have the MS Access error coding in my code and instead of opening a msgbox to display the error I would like to display my own popup form and populate the label with the error message.

I need to do this in one line of code if possible as I have 5000 lines to manually go through otherwise.

Any help would be appreciated.

regards
Terry

Answer : Open a form and populate an unbound field on the form being opened

You can't do this with "OpenForm", although you can pass a value in using OpenArgs. If you do that, then when the form opens, you'd just add code like this in the Open event:

Me.YourTextbox = Me.OpenArgs

---------------------------

I'm not sure what you mean by this:

"I have the MS Access error coding in my code and instead of opening a msgbox to display the error I would like to display my own popup form and populate the label with the error message."

Also, you should really only ask one question per posting, per EE guidelines (unless this is somehow tied in with the other part of your question).
Random Solutions  
 
programming4us programming4us