Help with automation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have two forms. On the first form there is a checkbox so when the user
clicks that check box the secord form pop's up. The first form has a field
called Report Number. The check box is becuase if more action is required
then another form needs to appear to allow the user to type in the action(and
some other fields). Is it possible to have a field on the second form for the
Report Number and have it automatically generated when the second form
appears? So, I want the user to click the checkbox and have the second form
pop up and already have the Report Number field populated becuase they need
to tie the two together.

Thanks,

Austin J. Hagen
 
If your first form knows what the report number is, then pass it to the
second form using OpenArgs. Then in the Load Event of the second form,
assign the value to the text box:

Me.txtReportNumber = OpenArgs
 
The 7th argument of the OpenForm method lets you pass an argument to the
form you're opening:

DoCmd.OpenForm formname[, view][, filtername][, wherecondition][,
datamode][, windowmode][, openargs]
 
You will have to put in your own arguments, but it is the last argument of
the openform method:

DoCmd.OpenForm "SecondForm", acNormal, , , , , Me.txtReportNo
 
After reading your post and Doug Steele post and viewing and modifying the
Not In List code I had used for another project I was able to accomplish my
task. This is the first time out of a dozen or so posts that I have had my
questions answered so thank you very much. Now back to the development of
more complex problems.

Thanks,

Austin J. Hagen
 
Back
Top