Z
Zachariah
frmNewSubmission has a subform frmApplicant.
Subform frmApplicant has hidden city state and zip data
and a button that lauches frmApplAddr.
frmApplAddr is a form where a user can fill in city state
and zip data.
The Form_Load() and Form_Current() events for
frmNewSubmission check to see if hidden city state and zip
data exist in frmApplicant.
If they exist a button called "Request Credit Report" is
enabled.
If they don't the button is disabled.
However I needed code to check data entered in
frmApplAddr. As well.
If frmApplAddr's city state and zip exist then it enables
frmNewSubmission's button.
If not the button is disabled. I put this code in the
Form_AfterUpdate() event
Here's my problem. I noticed that if I have one applicant
in frmApplAddr, the Form_AfterUpdate() code works fine,
but if there are two applicants, i.e. two records,
the second record is ignored. What am I doing wrong.
Here is the current checking code in frmApplAddr's
Form_AfterUpdate() event:
'Verify that City/State/ZipCode exist
Dim rs As DAO.Recordset
Dim p As Integer
Dim stCity As String
Dim stState As String
Dim stZipCode As String
p = 0
Set rs = Me.RecordsetClone
rs.MoveFirst
Do Until rs.EOF
If IsNull(City.Value) Then
stCity = "Bad"
Else
stCity = Trim(City.Value)
End If
If IsNull(State.Value) Then
stState = "Bad"
Else
stState = Trim(State.Value)
End If
If IsNull(ZipCode.Value) Then
stZipCode = "Bad"
Else
stZipCode = Trim(ZipCode.Value)
End If
If stCity = "Bad" Or stState = "Bad" Or stZipCode
= "Bad" Then
MsgBox ("Something is missing")
Else
MsgBox ("Everything looks okay")
p = p + 1
End If
rs.MoveNext
Loop
If p = rs.RecordCount Then
Forms!frmNewSubmission.CredRepReq.Enabled = True
Else
Forms!frmNewSubmission.CredRepReq.Enabled = False
End If
p = 0
Set rs = Nothing
Subform frmApplicant has hidden city state and zip data
and a button that lauches frmApplAddr.
frmApplAddr is a form where a user can fill in city state
and zip data.
The Form_Load() and Form_Current() events for
frmNewSubmission check to see if hidden city state and zip
data exist in frmApplicant.
If they exist a button called "Request Credit Report" is
enabled.
If they don't the button is disabled.
However I needed code to check data entered in
frmApplAddr. As well.
If frmApplAddr's city state and zip exist then it enables
frmNewSubmission's button.
If not the button is disabled. I put this code in the
Form_AfterUpdate() event
Here's my problem. I noticed that if I have one applicant
in frmApplAddr, the Form_AfterUpdate() code works fine,
but if there are two applicants, i.e. two records,
the second record is ignored. What am I doing wrong.
Here is the current checking code in frmApplAddr's
Form_AfterUpdate() event:
'Verify that City/State/ZipCode exist
Dim rs As DAO.Recordset
Dim p As Integer
Dim stCity As String
Dim stState As String
Dim stZipCode As String
p = 0
Set rs = Me.RecordsetClone
rs.MoveFirst
Do Until rs.EOF
If IsNull(City.Value) Then
stCity = "Bad"
Else
stCity = Trim(City.Value)
End If
If IsNull(State.Value) Then
stState = "Bad"
Else
stState = Trim(State.Value)
End If
If IsNull(ZipCode.Value) Then
stZipCode = "Bad"
Else
stZipCode = Trim(ZipCode.Value)
End If
If stCity = "Bad" Or stState = "Bad" Or stZipCode
= "Bad" Then
MsgBox ("Something is missing")
Else
MsgBox ("Everything looks okay")
p = p + 1
End If
rs.MoveNext
Loop
If p = rs.RecordCount Then
Forms!frmNewSubmission.CredRepReq.Enabled = True
Else
Forms!frmNewSubmission.CredRepReq.Enabled = False
End If
p = 0
Set rs = Nothing