Problem using UserForm in Macro
Hi Bob,
umm... it still doesn't work....
Terence
-----Original Message-----
Terence,
The form is being loaded before you populate the textbox.
Trying doing it
the other way around
Private Sub cmdButton_Click()
:
:
frmTest.txtbox1.Value = rst.Fields("testing")
frmTest.Show
End Sub
--
HTH
Bob Phillips
"Terence" wrote in message
...
Hi,
I am writing a macro with a button on the worksheet.
When
the button is clicked, the userform pops up and the data
of the recordset is displayed on the textbox of the
form.
e.g.
Private Sub cmdButton_Click()
:
:
frmTest.Show
frmTest.txtbox1.Value = rst.Fields("testing")
End Sub
However, the screen pops up but the textbox remains
empty.
Then I close the form and press the button again, the
screen pops up but this time the value is shown on the
textbox. Does anyone knows why?
Thanks a lot.
Terence
.
|