Coding two forms to save data

J

Joel

I have to forms that are linke by the following code
attached to a button:

Dim StDocNamame As string
Dim StLinkCriteria As string

DoCmd.Runcommand acCmd SaveRecord

StDocName "FRMCommunication"

StLinkCriteria = "[ContactID]=" & "" & Me![ContactID] & ""
DoCmd.OpenForm StDocName, , , StLinkCriteria



I am have 2 tables that have been made into forms. One
table if or contact info; Names, address etc and I have
another for Commmunication info like when lasted caleed
etc.

I fill in the first form and the click the communication
button it then opens up my second for but does not copy
of ver the primay key of that contact.

Can some One Please help thanks Joel
 
I

Ivan Grozney

Joel wrote...
-----Original Message-----
I have to forms that are linke by the following code
attached to a button:

Dim StDocNamame As string
Dim StLinkCriteria As string

DoCmd.Runcommand acCmd SaveRecord

StDocName "FRMCommunication"

StLinkCriteria = "[ContactID]=" & "" & Me![ContactID] & ""
DoCmd.OpenForm StDocName, , , StLinkCriteria



I am have 2 tables that have been made into forms. One
table if or contact info; Names, address etc and I have
another for Commmunication info like when lasted caleed
etc.

I fill in the first form and the click the communication
button it then opens up my second for but does not copy
of ver the primay key of that contact.

Can some One Please help thanks Joel
.

Joel,

Assuming that the second form you are opening is based
on the second table AND that there is no corresponding
contactID in the second table... On the second form, put
in for the default of the contactID from the first form.

defaultvalue =[forms]![form1]![contactID]

This will populate it with the contactID if it does't
exist.


hth
Ivan
alovercast@yahoo
 
J

Joel

DEar Ivan

Many thanks for that. I have it but I get an error.

To explan a little more my two tables are linked with a
1:M relationship. Have you any othe suggestions.

Thanks Joel
-----Original Message-----
Joel wrote...
-----Original Message-----
I have to forms that are linke by the following code
attached to a button:

Dim StDocNamame As string
Dim StLinkCriteria As string

DoCmd.Runcommand acCmd SaveRecord

StDocName "FRMCommunication"

StLinkCriteria = "[ContactID]=" & "" & Me![ContactID] & ""
DoCmd.OpenForm StDocName, , , StLinkCriteria



I am have 2 tables that have been made into forms. One
table if or contact info; Names, address etc and I have
another for Commmunication info like when lasted caleed
etc.

I fill in the first form and the click the communication
button it then opens up my second for but does not copy
of ver the primay key of that contact.

Can some One Please help thanks Joel
.

Joel,

Assuming that the second form you are opening is based
on the second table AND that there is no corresponding
contactID in the second table... On the second form, put
in for the default of the contactID from the first form.

defaultvalue =[forms]![form1]![contactID]

This will populate it with the contactID if it does't
exist.


hth
Ivan
alovercast@yahoo
.
 
I

Ivan

Joel,

If you want we can converse offline. I'd be happy to
send you an example db that shows what I am doing. Let me
know.

Ivan
alovercast on yahoo.com
-----Original Message-----
DEar Ivan

Many thanks for that. I have it but I get an error.

To explan a little more my two tables are linked with a
1:M relationship. Have you any othe suggestions.

Thanks Joel
-----Original Message-----
Joel wrote...
-----Original Message-----
I have to forms that are linke by the following code
attached to a button:

Dim StDocNamame As string
Dim StLinkCriteria As string

DoCmd.Runcommand acCmd SaveRecord

StDocName "FRMCommunication"

StLinkCriteria = "[ContactID]=" & "" & Me![ContactID] & ""
DoCmd.OpenForm StDocName, , , StLinkCriteria



I am have 2 tables that have been made into forms. One
table if or contact info; Names, address etc and I have
another for Commmunication info like when lasted caleed
etc.

I fill in the first form and the click the communication
button it then opens up my second for but does not copy
of ver the primay key of that contact.

Can some One Please help thanks Joel
.

Joel,

Assuming that the second form you are opening is based
on the second table AND that there is no corresponding
contactID in the second table... On the second form, put
in for the default of the contactID from the first form.

defaultvalue =[forms]![form1]![contactID]

This will populate it with the contactID if it does't
exist.


hth
Ivan
alovercast@yahoo
.
.
 
G

Guest

dEAR iVAN COULD WE CONVERSE OFFLINE

Thanks joel
-----Original Message-----
Joel,

If you want we can converse offline. I'd be happy to
send you an example db that shows what I am doing. Let me
know.

Ivan
alovercast on yahoo.com
-----Original Message-----
DEar Ivan

Many thanks for that. I have it but I get an error.

To explan a little more my two tables are linked with a
1:M relationship. Have you any othe suggestions.

Thanks Joel
-----Original Message-----
Joel wrote...

-----Original Message-----
I have to forms that are linke by the following code
attached to a button:

Dim StDocNamame As string
Dim StLinkCriteria As string

DoCmd.Runcommand acCmd SaveRecord

StDocName "FRMCommunication"

StLinkCriteria = "[ContactID]=" & "" & Me![ContactID] & ""
DoCmd.OpenForm StDocName, , , StLinkCriteria



I am have 2 tables that have been made into forms. One
table if or contact info; Names, address etc and I have
another for Commmunication info like when lasted caleed
etc.

I fill in the first form and the click the communication
button it then opens up my second for but does not copy
of ver the primay key of that contact.

Can some One Please help thanks Joel
.


Joel,

Assuming that the second form you are opening is based
on the second table AND that there is no corresponding
contactID in the second table... On the second form, put
in for the default of the contactID from the first form.

defaultvalue =[forms]![form1]![contactID]

This will populate it with the contactID if it does't
exist.


hth
Ivan
alovercast@yahoo
.
.
.
 
I

Ivan

Joel,

Give me a mail at (e-mail address removed). I'll send you
a copy of a database that does what I think you want done.

Ivan
-----Original Message-----
dEAR iVAN COULD WE CONVERSE OFFLINE

Thanks joel
-----Original Message-----
Joel,

If you want we can converse offline. I'd be happy to
send you an example db that shows what I am doing. Let me
know.

Ivan
alovercast on yahoo.com
-----Original Message-----
DEar Ivan

Many thanks for that. I have it but I get an error.

To explan a little more my two tables are linked with a
1:M relationship. Have you any othe suggestions.

Thanks Joel
-----Original Message-----
Joel wrote...

-----Original Message-----
I have to forms that are linke by the following code
attached to a button:

Dim StDocNamame As string
Dim StLinkCriteria As string

DoCmd.Runcommand acCmd SaveRecord

StDocName "FRMCommunication"

StLinkCriteria = "[ContactID]=" & "" & Me![ContactID]
& ""
DoCmd.OpenForm StDocName, , , StLinkCriteria



I am have 2 tables that have been made into forms. One
table if or contact info; Names, address etc and I have
another for Commmunication info like when lasted caleed
etc.

I fill in the first form and the click the
communication
button it then opens up my second for but does not copy
of ver the primay key of that contact.

Can some One Please help thanks Joel
.


Joel,

Assuming that the second form you are opening is
based
on the second table AND that there is no corresponding
contactID in the second table... On the second form,
put
in for the default of the contactID from the first form.

defaultvalue =[forms]![form1]![contactID]

This will populate it with the contactID if it does't
exist.


hth
Ivan
alovercast@yahoo
.

.
.
.
 

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

Similar Threads

If Statements 4
Transfer contactID to Event Registration 2
Criteria when opening form 1
cannot filter continuous form data 2
stLinkCriteria 3
Inserting data in forms 2
can't find form 4
Copying from two forms 10

Top