I have a form that after information is entered, you get an RFQ Number.
If you press the expedite button, then a second form opens to enter
the expedite information. After you close it, it creates a record
linking by RFQ Number. I am trying to set up a hidden text box that says
"Expedited" on the main form, if it has an expedite record that matches
the RFQ Number. I have the following " On Form Activate" event on the main
RFQ form:
Private Sub Form_Activate()
If IsNull(Forms!frm_newrfq!RFQ_Number) Then
Me.expedited.Visible = False
Exit Sub
Else
Dim rs_expedite As DAO.Recordset
Dim str_expedite As String
Dim RFQ_Number As String
str_expedite = "SELECT Expedite.RFQNumber" & _
" FROM Expedite"
RFQ_Number = (Forms!frm_newrfq!RFQ_Number)
Set rs_expedite = CurrentDb().OpenRecordset(str_expedite)
With rs_expedite
.FindFirst RFQ_Number
If Not .EOF Then
Me.expedited.Visible = True
Else
Me.expedited.Visible = False
End If
.Close
End With
End If
End Sub
What am I doing wrong?
Thanks,
Chris