Open form with a button setting parameters

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

Guest

Is it possible to use a button to open a form, but set that form's parameters
in the event properties of the button. For example, I may wish to use a
different query as Record Source for that form depending upon which button
was used to open it. Or, I may wish to have different values for Allow
Deletions etc.

I think it may be that I need to use the "With" statement in VB, but don't
know how to.

I hope I have made my myself clear, if not please ask me to clarify.

All help gratefully received.
 
Hi Doris,

I would use code that looks something like this.

DoCmd.OpenForm "form"
Forms("form").RecordSource = "qrySelectRecords"
Forms("form").AllowAdditions = False

Jim
 
Back
Top