I
Imran J Khan
FormA displays results of search. Double clicking on any one of the results
opens FormB to details of that record.
Eventhough I have removed the record navigation menu, the user can scroll to
a new record on FormB with the use of the mouse wheel. Since FormB is not
intended to create new records, but allows for updates to existing records, I
force the formB back to old record (the one selected using FormA) by checking
if me.NewRecord is true and then use a variable 'strSQL' that has stored the
old recordsource and reset the new record's recordsource. I use call from
FromB.Current event to run this function. This works great.
However, during development, when I open the form in Form View from design
view, it gets stuck in a loop where the recordsource keeps being set to
me.newrecord. How do I catch this?
Public Function setLoopFirstRecord(frm As Form)
Dim strSql As String
Dim intnewrec As Integer
strSql = frm.RecordSource
intnewrec = frm.NewRecord
If intnewrec = True Then
frm.RecordSource = strSql
End If
End Function
Imran J Khan
opens FormB to details of that record.
Eventhough I have removed the record navigation menu, the user can scroll to
a new record on FormB with the use of the mouse wheel. Since FormB is not
intended to create new records, but allows for updates to existing records, I
force the formB back to old record (the one selected using FormA) by checking
if me.NewRecord is true and then use a variable 'strSQL' that has stored the
old recordsource and reset the new record's recordsource. I use call from
FromB.Current event to run this function. This works great.
However, during development, when I open the form in Form View from design
view, it gets stuck in a loop where the recordsource keeps being set to
me.newrecord. How do I catch this?
Public Function setLoopFirstRecord(frm As Form)
Dim strSql As String
Dim intnewrec As Integer
strSql = frm.RecordSource
intnewrec = frm.NewRecord
If intnewrec = True Then
frm.RecordSource = strSql
End If
End Function
Imran J Khan