A
Amour
Hi I am new to Access.
I have a Single Form (frmAtt) that when I select a record I than can click
on a button to open another Continuous form (frmTrv) and it will select that
records information from frmAtt.
Example:
Opened form(frmatt) = Opening form(frmTrv)
frmatt.xyz = A frmtrv.xyz = A
frmatt.zzz = B frmtrv.zzz = B
This part works fine...
But when I close frmtrv this is what happens:
Opened form(frmatt) closed form(frmTrv)
frmtrv.xyz = A frmatt.xyz = someother record
frmtrv.zzz = B frmatt.zzz = B
THIS IS THE PROBLEM!
When I delete the record from frmtrv:
Opened form(frmatt) closed form(frmTrv)
frmtrv.xyz = A frmatt.xyz = A
frmtrv.zzz = B frmatt.zzz = B
This works fine!
I want the frmtrv to close with the current record on the previous opened
form showing.
Here is the code behind the close button on the frmtrv:
Private Sub btnCloseForm_Click()
On Error GoTo Err_btnCloseForm_Click
lngMyKey = Me.txtSSN
Me.Requery
Set rst = Me.RecordsetClone
rst.FindFirst "[ssn] = " & lngMyKey
MsgBox Me!SSN
If rst.NoMatch Then
MsgBox "Error Find Record " & lngMyKey
Else
Me.Bookmark = rst.Bookmark
End If
Set rst = Nothing
DoCmd.Close
Exit_btnCloseForm_Click:
Exit Sub
Err_btnCloseForm_Click:
MsgBox Error$
Resume Exit_btnCloseForm_Click
End Sub
MsgBox Me!SSN = Ex: 000-00-6148
lngMyKey = Ex: 000-00-6148
Yet I get the msg: Error Find Record 00-00-6148
meaning that: rst.NoMatch is true
What am I doing wrong SSN does equal IngMyKey
Please help and thank you!
I have a Single Form (frmAtt) that when I select a record I than can click
on a button to open another Continuous form (frmTrv) and it will select that
records information from frmAtt.
Example:
Opened form(frmatt) = Opening form(frmTrv)
frmatt.xyz = A frmtrv.xyz = A
frmatt.zzz = B frmtrv.zzz = B
This part works fine...
But when I close frmtrv this is what happens:
Opened form(frmatt) closed form(frmTrv)
frmtrv.xyz = A frmatt.xyz = someother record
frmtrv.zzz = B frmatt.zzz = B
THIS IS THE PROBLEM!
When I delete the record from frmtrv:
Opened form(frmatt) closed form(frmTrv)
frmtrv.xyz = A frmatt.xyz = A
frmtrv.zzz = B frmatt.zzz = B
This works fine!
I want the frmtrv to close with the current record on the previous opened
form showing.
Here is the code behind the close button on the frmtrv:
Private Sub btnCloseForm_Click()
On Error GoTo Err_btnCloseForm_Click
lngMyKey = Me.txtSSN
Me.Requery
Set rst = Me.RecordsetClone
rst.FindFirst "[ssn] = " & lngMyKey
MsgBox Me!SSN
If rst.NoMatch Then
MsgBox "Error Find Record " & lngMyKey
Else
Me.Bookmark = rst.Bookmark
End If
Set rst = Nothing
DoCmd.Close
Exit_btnCloseForm_Click:
Exit Sub
Err_btnCloseForm_Click:
MsgBox Error$
Resume Exit_btnCloseForm_Click
End Sub
MsgBox Me!SSN = Ex: 000-00-6148
lngMyKey = Ex: 000-00-6148
Yet I get the msg: Error Find Record 00-00-6148
meaning that: rst.NoMatch is true
What am I doing wrong SSN does equal IngMyKey
Please help and thank you!