Passing An Argument To A New Form's Control

  • Thread starter Thread starter nouveauricheinvestments
  • Start date Start date
N

nouveauricheinvestments

I opened a form via a button and I want to pass an argument to a combo
box control on that form. When the new form opens, the control I want
to preset is blank instead of containing the value it should have.
This is the code I am trying to use:

Private Sub DocumentTicket_Click()
DoCmd.OpenForm "DocumentATicket"
Form_DocumentATicket.LoggedByCombo.Value = ThisUser

End Sub
 
Use:
Forms("DocumentATicket")!LoggedByCombo = ThisUser

Your code doesn't show where ThisUser comes from.
 
Try this:

Private Sub DocumentTicket_Click()
DoCmd.OpenForm "DocumentATicket"
Forms!DocumentATicket!LoggedByCombo.Value = ThisUser
 
Try this:

Private Sub DocumentTicket_Click()
DoCmd.OpenForm "DocumentATicket"
Forms!DocumentATicket!LoggedByCombo.Value = ThisUser

Perfect. Issues resolved. Thank you.
 
Back
Top