Hi,
I have a form frmMeeting bound to a table tblMeeting. Structure of the table is below:
MeetingID: PK, Long
MeetingDate: Date Time
MeetingDesc: Text
ClientID: FK, Long
EmployeeID: FK, Long
I want to know the primary key name on form OnLoad event using VBA. The reason why I need this programmatically is I need to input it in initialize sub's parameter of a class module. I can give field name manually for the main form but it can't be for the subform as it iterate through all the controls of the form and initialize new instance if control is a subform.
Can you please guide me how can I get name of PK field of the record source table of a form? Thanks in advance.
Best Regards
I have a form frmMeeting bound to a table tblMeeting. Structure of the table is below:
MeetingID: PK, Long
MeetingDate: Date Time
MeetingDesc: Text
ClientID: FK, Long
EmployeeID: FK, Long
I want to know the primary key name on form OnLoad event using VBA. The reason why I need this programmatically is I need to input it in initialize sub's parameter of a class module. I can give field name manually for the main form but it can't be for the subform as it iterate through all the controls of the form and initialize new instance if control is a subform.
Can you please guide me how can I get name of PK field of the record source table of a form? Thanks in advance.
Best Regards