M
Madhusudhan
Hi
I am new to Access & VB and have a question I hope you can answer:
I have around 10 forms that merely display current record contents and
allow changing current values of fields or adding a new record. Each
form represents a separate entity (user1, managers, rooms_and_equipment
etc. )but in essence, the basic processing of data in the forms are
pretty much the same.
So I'm trying to centralize the common functionalities like saving a
change, finding a record, deleting a record etc. In trying to do so, I
find myself clueless when it comes to handling the DoCmd object and its
properties which seem pretty ubiquitous in access,vb code.
Example:
1. The following code is at the form level. I want to put the main
functionality in a sub in Main()
and just call the corresponding function from this form. Can you please
show me a sample of how I go about that?
Private Sub cmd_Save_Conf_Click()
On Error GoTo Err_cmd_Save_Conf_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
gRecordSaved = True
Exit_cmd_Save_Conf_Click:
Exit Sub
Err_cmd_Save_Conf_Click:
MsgBox Err.Description
Resume Exit_cmd_Save_Conf_Click
End Sub
2. I see the usage of "Form" ( IsNull(Form.[conf_id]) ) to refer to
active form in certain places and "Me" in others. WHats the difference
between Form and Me?
3. Whats the difference between the . and the ! used to refer to
members of a form?
Thank you,
Madhu
I am new to Access & VB and have a question I hope you can answer:
I have around 10 forms that merely display current record contents and
allow changing current values of fields or adding a new record. Each
form represents a separate entity (user1, managers, rooms_and_equipment
etc. )but in essence, the basic processing of data in the forms are
pretty much the same.
So I'm trying to centralize the common functionalities like saving a
change, finding a record, deleting a record etc. In trying to do so, I
find myself clueless when it comes to handling the DoCmd object and its
properties which seem pretty ubiquitous in access,vb code.
Example:
1. The following code is at the form level. I want to put the main
functionality in a sub in Main()
and just call the corresponding function from this form. Can you please
show me a sample of how I go about that?
Private Sub cmd_Save_Conf_Click()
On Error GoTo Err_cmd_Save_Conf_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
gRecordSaved = True
Exit_cmd_Save_Conf_Click:
Exit Sub
Err_cmd_Save_Conf_Click:
MsgBox Err.Description
Resume Exit_cmd_Save_Conf_Click
End Sub
2. I see the usage of "Form" ( IsNull(Form.[conf_id]) ) to refer to
active form in certain places and "Me" in others. WHats the difference
between Form and Me?
3. Whats the difference between the . and the ! used to refer to
members of a form?
Thank you,
Madhu