Coding two forms to save data

  • Thread starter Thread starter Joel
  • Start date Start date
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
 
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
 
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
.
 
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
.
.
 
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
.
.
.
 
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
.

.
.
.
 
Back
Top