Moving Main form record to the one selected in another form (1 Viewer)

MeSRB

New member
Local time
Tomorrow, 01:59
Joined
Feb 8, 2022
Messages
3
Hello, experts,
I am learning Access and VBA by trial and error. Currently i am trying to design a database (access2007). It has two Tables. 1) tblWorkOrder 2) tblWorkPlace., one main form, frmWorkorder. This main form has a subform , frmworkplacesubform.. Data from frmWorkorder gets stored in tblworkorder and subform data goes to tblworkplace.. Another form, frmworkorderlist, displays all the records of the table tblworkorder.

i have managed to synchronize subform records to main form. but i am stuck at on problem which , even after lot of search and trial, not able to solve. Kindly help.

As shown in the attached image, when i open the frmworkorder, it opens the first record, as shown by the default navigation buttons. That is ok. but when i select another record, say record no 3, through the form frmworkorderlist, record does show in the form controls but the navigation buttons still show the first record. i am not able make it the current record.


Thanks in advance
 

Attachments

  • dataentryform.jpg
    dataentryform.jpg
    85.7 KB · Views: 215

Jon

Access World Site Owner
Staff member
Local time
Today, 21:29
Joined
Sep 28, 1999
Messages
7,383
Welcome to the forums! We are the most active Microsoft Access community on the internet by far, with posts going back over 20 years!

To get started, I highly recommend you read the post below. It contains important information for all new users to this forum.

https://www.access-programmers.co.uk/forums/threads/new-member-read-me-first.223250/

We look forward to having you around here, learning stuff and having fun!
 

MeSRB

New member
Local time
Tomorrow, 01:59
Joined
Feb 8, 2022
Messages
3
I think i have posted my question in "introduce yourself" section. Kindly excuse
 

MeSRB

New member
Local time
Tomorrow, 01:59
Joined
Feb 8, 2022
Messages
3
as per my search, i think the following code should work:
Private Sub Form_Current()
'Move to the record selected in the control
Me.RecordsetClone.FindFirst "[RegisterNo] = " & Me![txtRegNo]
Me.Bookmark = Me.RecordsetClone.Bookmark

End Sub
But i am getting, 'Runtime error 3077: syntax error(missing operator) in expression.

Please let me know what is wrong in the above code.

Thanks
 

Users who are viewing this thread

Top Bottom