S
sike11 via AccessMonster.com
Hi,
I wonder if you can help. I have a form which inputs qualification details
into a table. During testing, I notice that when I miss data from one of the
fields, I do get an error message. The form then refreshes rather than all
the details being left as it is for the user to correct the details. Below is
the code I am using. Please help.
For i = 1 To 12
If q(i) <> "" And n(i) <> "" And g(i) <> "" Then
Call InsertFirstNew
Call InsertSecondNew(q(i), n(i), g(i))
ElseIf q(i) = "" And n(i) = "" And g(i) = "" Then
intAllBlank = intAllBlank + 1
Else
MsgBox "Please check again!", vbExclamation
End If
Next i
If intAllBlank = 12 Then 'If all records are blank
MsgBox "Please check again!", vbExclamation
Else
If intAllBlank < 12 Then 'If records are not blank
Call ClearForm
End If
End If
How would I modify the code to print the error message and leave the details
as they are in the form?
Regards,
Mary.
I wonder if you can help. I have a form which inputs qualification details
into a table. During testing, I notice that when I miss data from one of the
fields, I do get an error message. The form then refreshes rather than all
the details being left as it is for the user to correct the details. Below is
the code I am using. Please help.
For i = 1 To 12
If q(i) <> "" And n(i) <> "" And g(i) <> "" Then
Call InsertFirstNew
Call InsertSecondNew(q(i), n(i), g(i))
ElseIf q(i) = "" And n(i) = "" And g(i) = "" Then
intAllBlank = intAllBlank + 1
Else
MsgBox "Please check again!", vbExclamation
End If
Next i
If intAllBlank = 12 Then 'If all records are blank
MsgBox "Please check again!", vbExclamation
Else
If intAllBlank < 12 Then 'If records are not blank
Call ClearForm
End If
End If
How would I modify the code to print the error message and leave the details
as they are in the form?
Regards,
Mary.