I have a form with a command button on it.
Then onClick event pushes a value to an unbound text box on a separate form.
When frmB opens, a listbox uses the value in Text45 as criteria
However, even though I can see a value in Text45 it is evaluated as NULL by the code firing OnLoad...
I have tried different methods to force the form to pick up the value and populate the listbox
Me.Refresh
Me.Repaint
Me.Requery
Me.Recalc
but none of them are working. The listbox only populates if I open the form in design view and reopen it normally.
I have seen some comments about OpenArgs (I am not familiar with how to use this) but wondered if there was something simple I was missing?
Then onClick event pushes a value to an unbound text box on a separate form.
Code:
' 1.Open second form
DoCmd.OpenForm "frmB"
' 2. Set the default value of the text box on the form
Forms.frmB.Text45 = Me.PLID
When frmB opens, a listbox uses the value in Text45 as criteria
Code:
Private Sub Form_Load()
With Me.List41
.RowSource = _
"SELECT * " & _
"FROM Table1 " & _
"WHERE Table1.PLID = " & Me.Text45
End With
End Sub
However, even though I can see a value in Text45 it is evaluated as NULL by the code firing OnLoad...
I have tried different methods to force the form to pick up the value and populate the listbox
Me.Refresh
Me.Repaint
Me.Requery
Me.Recalc
but none of them are working. The listbox only populates if I open the form in design view and reopen it normally.
I have seen some comments about OpenArgs (I am not familiar with how to use this) but wondered if there was something simple I was missing?