lngBookmark - Going to the current record on a new form (1 Viewer)

Raya4505

New member
Local time
Today, 15:19
Joined
Aug 8, 2013
Messages
1
I am a self-taught Access user and I am needing help with some VBA coding that is a little out of my league. I have two forms and I am wanting the second form to open (when a button is clicked) to the second form, but to the same record. Here is the coding I have…

Private Sub NavigationButton26_Click()
Dim rs As Object
Dim lngBookmark As String

'set a variable to the current record
lngBookmark = Me.[Member ID]

'open the new form
DoCmd.OpenForm "QOL Follow Up"

'take it to the selected record
Set rs = [Form_QOL Follow Up].RecordsetClone
rs.FindFirst "RID ='" & lngBookmark & "'"

'if there's a chance the record won't exist in the form being opened
If rs.NoMatch Then ' if no match, go to a new record
DoCmd.GoToRecord acForm, "QOL Follow Up", acNewRec
Forms!LivingChoiceProjectReportingDB.Member ID = Me.[RID] 'copy the ID from this form

End If
End Sub

I have gotten rid of all the error messages, but the issue is that its still just going to the first record in form 2 no matter what record I was on in form 1. Form 1 is Living Choice Project Reporting DB and the field that I need it to draw from is “Member ID” the second form is QOL Follow up and the field is RID. Any help would be SO SO SO greatly appreciated and you would get tons of nerdy cool points.

Thanks for the help!
 

Users who are viewing this thread

Top Bottom