Hi,
I am using VBA to open a from from another form. The Code to open the form is as follows:
Code:
Private Sub txtDayBlock04_DblClick(Cancel As Integer)
tempDate = CDate(Me![txtDayBlock04].Tag)
DoCmd.OpenForm "frmPatients", acNormal, , "[Date] = #" & CDate(Me![txtDayBlock04].Tag) & "#"
End Sub
tempDate is a Public Var Dim'd in a Module
The Form_Load Event reads:
Code:
Private Sub Form_Load()
[Date] = tempDate
End Sub
Problem is when the form loads, only the first instance of [Date] is set to the tempDate variable. If no record exists, then the new instance of [Date] is set to tempDate. The desired effect is any time the form loads, only a new instance (therefore a new record in the db) is set to tempDate.
Any ideas?
TIA VM
TB