I
Ian
I think this is a simple question but.....
I have a form with an 'accept' button I've built at the bottom. When the
user hits accept is runs an append query using some of the data in the form
in the query then closes the form. The first time I hit the accept button
none of the data is grabbed by the query but if I open the form a second
time, hit the accept button a second time it works. I think I need to
refresh the form prior to running the query. Here's part of the code for the
accept button;
On Error GoTo Err_Accept_Click
'prevent entering drug without user or expire date
If IsNull(Me!TotQuan) Or IsNull(Me!ReceivedBy) Or IsNull(Me!ExpireDate)
Then
MsgBox "'Expire Date'; Quantity' or 'Received By' is blank", vbCritical
Else
DoCmd.OpenQuery "Qry_DistCreateEntry"
DoCmd.Close
End If
Qry_DistCreateEntry is the append query and grabs data such as
[forms].[frm_drugentry].[id] for the append.
Do I need another statement below the Else command? Thx. Ian.
I have a form with an 'accept' button I've built at the bottom. When the
user hits accept is runs an append query using some of the data in the form
in the query then closes the form. The first time I hit the accept button
none of the data is grabbed by the query but if I open the form a second
time, hit the accept button a second time it works. I think I need to
refresh the form prior to running the query. Here's part of the code for the
accept button;
On Error GoTo Err_Accept_Click
'prevent entering drug without user or expire date
If IsNull(Me!TotQuan) Or IsNull(Me!ReceivedBy) Or IsNull(Me!ExpireDate)
Then
MsgBox "'Expire Date'; Quantity' or 'Received By' is blank", vbCritical
Else
DoCmd.OpenQuery "Qry_DistCreateEntry"
DoCmd.Close
End If
Qry_DistCreateEntry is the append query and grabs data such as
[forms].[frm_drugentry].[id] for the append.
Do I need another statement below the Else command? Thx. Ian.