help with docmd, "Form"

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
 
T

tina

please don't multi-post. it wastes server space, and wastes the time of
people who may work to answer your question in one newsgroup - not knowing
that it's already been answered in another newsgroup.

if you really feel you must post to more than one group (rarely necessary),
then cross-post, by putting both newsgroup addresses in a single message. if
you post a message in the "wrong" newsgroup, either stick with it for a day
or two - because you may get help anyway - or at least post a follow-up
message in the thread as a courtesy, to say that you're abandoning it, so
people won't waste time on it.

hth
 
P

Papa Jonah

that didn't help me - especially since I don't know where the other post is.

tina said:
please don't multi-post. it wastes server space, and wastes the time of
people who may work to answer your question in one newsgroup - not knowing
that it's already been answered in another newsgroup.

if you really feel you must post to more than one group (rarely necessary),
then cross-post, by putting both newsgroup addresses in a single message. if
you post a message in the "wrong" newsgroup, either stick with it for a day
or two - because you may get help anyway - or at least post a follow-up
message in the thread as a courtesy, to say that you're abandoning it, so
people won't waste time on it.

hth


Madhusudhan said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top