Show current record, THEN check control

  • Thread starter Thread starter bw
  • Start date Start date
B

bw

Consider the following:

Private Sub Form_Current()
If Me!Status = "Converted" Then
If Me![OC] > 0 Or Me![ODB] > 0 Or Me![OInst] > 0 Then
Else
MsgBox "The Assignment is incomplete.", vbInformation, "Assignments"
End If
End If
End Sub

The message is displayed BEFORE the current record Form is displayed.
I want the current record to be displayed FIRST, and then have the message show on
top of the current record Form.

Nothing I try seems to work.

What is the proper event(s) to use for this, and is there any special coding that would be
necessary?

Thanks,
Bernie
 
Form_Current is the logical event to use.

Would you consider placing an unbound text box across the bottom of your
form, and placing messages there instead of popping up the MsgBox? This
would be less intrusive, and the timing issue would disappear.

The alternative would be to set a form-level string variable in
Form_Current, and then use the form's Timer event to display the MsgBox
later and reset the string. In my view, introducing the oddities of the
Timer event would be a less desireable option.
 
Excellent, Allen! ! !

No, I had not considered this, but it is exactly what I was looking for, and I agree, much
better than the pop up message.

Thanks much for the suggestion.
Bernie


Form_Current is the logical event to use.

Would you consider placing an unbound text box across the bottom of your
form, and placing messages there instead of popping up the MsgBox? This
would be less intrusive, and the timing issue would disappear.

The alternative would be to set a form-level string variable in
Form_Current, and then use the form's Timer event to display the MsgBox
later and reset the string. In my view, introducing the oddities of the
Timer event would be a less desireable option.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

bw said:
Consider the following:

Private Sub Form_Current()
If Me!Status = "Converted" Then
If Me![OC] > 0 Or Me![ODB] > 0 Or Me![OInst] > 0 Then
Else
MsgBox "The Assignment is incomplete.", vbInformation, "Assignments"
End If
End If
End Sub

The message is displayed BEFORE the current record Form is displayed.
I want the current record to be displayed FIRST, and then have the message show on
top of the current record Form.

Nothing I try seems to work.

What is the proper event(s) to use for this, and is there any special coding that would be
necessary?

Thanks,
Bernie
 
Back
Top