PC Review


Reply
Thread Tools Rate Thread

Creating sub entry

 
 
Steve Newport
Guest
Posts: n/a
 
      3rd Jan 2008
Sorry basic question but I am going around in circles.

I have a simple supplier table with Supplier ID as key. I open a new table
with a form in preparation to add a new record in the second table
(Contacts). Form opens OK and you can add entries but I want to copy across
the Supplier ID so that it maintains the relationship. Tried several ways but
cant manage it.

The VB behind the relevant button that opens the form reads:

Private Sub CMD_AddContact_Click()
On Error GoTo Err_CMD_AddContact_Click

Dim stDocName As String
Dim stSupplierID As String

stDocName = "FRM_ContactsAdd"
stSupplierID = SupplierID

DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal

Exit_CMD_AddContact_Click:
Exit Sub

Err_CMD_AddContact_Click:
MsgBox Err.Description
Resume Exit_CMD_AddContact_Click

End Sub

Which I have messed around with a bit. How should I be doing this?

Many thanks


 
Reply With Quote
 
 
 
 
Tom van Stiphout
Guest
Posts: n/a
 
      3rd Jan 2008
On Thu, 3 Jan 2008 05:39:00 -0800, Steve Newport
<(E-Mail Removed)> wrote:

You should create a single form, bound to the Suppliers table. Then
have a subform on that form to enter Contacts for the supplier. When
you drop the subform on the form Access will ask you about linking,
and you then link SuppliersID from the parent form to the subform (or
later set the LinkMasterFields and LinkChildFields properties of the
subform control).

Study the Northwind sample application - Orders form: it has an
OrderDetails subform linked to the parent Order.

-Tom.


>Sorry basic question but I am going around in circles.
>
>I have a simple supplier table with Supplier ID as key. I open a new table
>with a form in preparation to add a new record in the second table
>(Contacts). Form opens OK and you can add entries but I want to copy across
>the Supplier ID so that it maintains the relationship. Tried several ways but
>cant manage it.
>
>The VB behind the relevant button that opens the form reads:
>
>Private Sub CMD_AddContact_Click()
>On Error GoTo Err_CMD_AddContact_Click
>
> Dim stDocName As String
> Dim stSupplierID As String
>
> stDocName = "FRM_ContactsAdd"
> stSupplierID = SupplierID
>
> DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal
>
>Exit_CMD_AddContact_Click:
> Exit Sub
>
>Err_CMD_AddContact_Click:
> MsgBox Err.Description
> Resume Exit_CMD_AddContact_Click
>
>End Sub
>
>Which I have messed around with a bit. How should I be doing this?
>
>Many thanks
>

 
Reply With Quote
 
Arvin Meyer [MVP]
Guest
Posts: n/a
 
      3rd Jan 2008
If you use the last argument, called OpenArgs in the OpenForm Method, you
can get what you want.

DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal, Me.[Supplier
ID]

Now, in the second form's Open event use a line like:

Me.txtSupplierID = Me.OpenArgs
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Steve Newport" <(E-Mail Removed)> wrote in message
news:6166E18C-1120-4627-A4DF-(E-Mail Removed)...
> Sorry basic question but I am going around in circles.
>
> I have a simple supplier table with Supplier ID as key. I open a new table
> with a form in preparation to add a new record in the second table
> (Contacts). Form opens OK and you can add entries but I want to copy
> across
> the Supplier ID so that it maintains the relationship. Tried several ways
> but
> cant manage it.
>
> The VB behind the relevant button that opens the form reads:
>
> Private Sub CMD_AddContact_Click()
> On Error GoTo Err_CMD_AddContact_Click
>
> Dim stDocName As String
> Dim stSupplierID As String
>
> stDocName = "FRM_ContactsAdd"
> stSupplierID = SupplierID
>
> DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal
>
> Exit_CMD_AddContact_Click:
> Exit Sub
>
> Err_CMD_AddContact_Click:
> MsgBox Err.Description
> Resume Exit_CMD_AddContact_Click
>
> End Sub
>
> Which I have messed around with a bit. How should I be doing this?
>
> Many thanks
>
>



 
Reply With Quote
 
Steve Newport
Guest
Posts: n/a
 
      3rd Jan 2008
Many thanks for that - its miore like I expected to do but I am a bit
confused by the second part. The first piece of code I entered using the
DoCmd.Openform was in the event for the button to press to open the second
form.

When you say the second forms Open event - exactly where do you mean? Isn't
it the same block of code?

"Arvin Meyer [MVP]" wrote:

> If you use the last argument, called OpenArgs in the OpenForm Method, you
> can get what you want.
>
> DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal, Me.[Supplier
> ID]
>
> Now, in the second form's Open event use a line like:
>
> Me.txtSupplierID = Me.OpenArgs
> --
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
> "Steve Newport" <(E-Mail Removed)> wrote in message
> news:6166E18C-1120-4627-A4DF-(E-Mail Removed)...
> > Sorry basic question but I am going around in circles.
> >
> > I have a simple supplier table with Supplier ID as key. I open a new table
> > with a form in preparation to add a new record in the second table
> > (Contacts). Form opens OK and you can add entries but I want to copy
> > across
> > the Supplier ID so that it maintains the relationship. Tried several ways
> > but
> > cant manage it.
> >
> > The VB behind the relevant button that opens the form reads:
> >
> > Private Sub CMD_AddContact_Click()
> > On Error GoTo Err_CMD_AddContact_Click
> >
> > Dim stDocName As String
> > Dim stSupplierID As String
> >
> > stDocName = "FRM_ContactsAdd"
> > stSupplierID = SupplierID
> >
> > DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal
> >
> > Exit_CMD_AddContact_Click:
> > Exit Sub
> >
> > Err_CMD_AddContact_Click:
> > MsgBox Err.Description
> > Resume Exit_CMD_AddContact_Click
> >
> > End Sub
> >
> > Which I have messed around with a bit. How should I be doing this?
> >
> > Many thanks
> >
> >

>
>
>

 
Reply With Quote
 
Arvin Meyer [MVP]
Guest
Posts: n/a
 
      3rd Jan 2008
No the first line of code is in the button on the first form that opens the
second one. The second form's Open event, needs to read the OpenOrgs that's
passed from form number 1.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Steve Newport" <(E-Mail Removed)> wrote in message
news:90983ABE-5A93-4EC2-A510-(E-Mail Removed)...
> Many thanks for that - its miore like I expected to do but I am a bit
> confused by the second part. The first piece of code I entered using the
> DoCmd.Openform was in the event for the button to press to open the second
> form.
>
> When you say the second forms Open event - exactly where do you mean?
> Isn't
> it the same block of code?
>
> "Arvin Meyer [MVP]" wrote:
>
>> If you use the last argument, called OpenArgs in the OpenForm Method, you
>> can get what you want.
>>
>> DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal, Me.[Supplier
>> ID]
>>
>> Now, in the second form's Open event use a line like:
>>
>> Me.txtSupplierID = Me.OpenArgs
>> --
>> Arvin Meyer, MCP, MVP
>> http://www.datastrat.com
>> http://www.mvps.org/access
>> http://www.accessmvp.com
>>
>> "Steve Newport" <(E-Mail Removed)> wrote in message
>> news:6166E18C-1120-4627-A4DF-(E-Mail Removed)...
>> > Sorry basic question but I am going around in circles.
>> >
>> > I have a simple supplier table with Supplier ID as key. I open a new
>> > table
>> > with a form in preparation to add a new record in the second table
>> > (Contacts). Form opens OK and you can add entries but I want to copy
>> > across
>> > the Supplier ID so that it maintains the relationship. Tried several
>> > ways
>> > but
>> > cant manage it.
>> >
>> > The VB behind the relevant button that opens the form reads:
>> >
>> > Private Sub CMD_AddContact_Click()
>> > On Error GoTo Err_CMD_AddContact_Click
>> >
>> > Dim stDocName As String
>> > Dim stSupplierID As String
>> >
>> > stDocName = "FRM_ContactsAdd"
>> > stSupplierID = SupplierID
>> >
>> > DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal
>> >
>> > Exit_CMD_AddContact_Click:
>> > Exit Sub
>> >
>> > Err_CMD_AddContact_Click:
>> > MsgBox Err.Description
>> > Resume Exit_CMD_AddContact_Click
>> >
>> > End Sub
>> >
>> > Which I have messed around with a bit. How should I be doing this?
>> >
>> > Many thanks
>> >
>> >

>>
>>
>>



 
Reply With Quote
 
Steve Newport
Guest
Posts: n/a
 
      4th Jan 2008
Thanks. Done that but I get a "Compile error" saying "Wrong number of
arguments or invalid property assignment".

I have entered both sets of codes as described.

Any ideas?

"Arvin Meyer [MVP]" wrote:

> No the first line of code is in the button on the first form that opens the
> second one. The second form's Open event, needs to read the OpenOrgs that's
> passed from form number 1.
> --
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
> "Steve Newport" <(E-Mail Removed)> wrote in message
> news:90983ABE-5A93-4EC2-A510-(E-Mail Removed)...
> > Many thanks for that - its miore like I expected to do but I am a bit
> > confused by the second part. The first piece of code I entered using the
> > DoCmd.Openform was in the event for the button to press to open the second
> > form.
> >
> > When you say the second forms Open event - exactly where do you mean?
> > Isn't
> > it the same block of code?
> >
> > "Arvin Meyer [MVP]" wrote:
> >
> >> If you use the last argument, called OpenArgs in the OpenForm Method, you
> >> can get what you want.
> >>
> >> DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal, Me.[Supplier
> >> ID]
> >>
> >> Now, in the second form's Open event use a line like:
> >>
> >> Me.txtSupplierID = Me.OpenArgs
> >> --
> >> Arvin Meyer, MCP, MVP
> >> http://www.datastrat.com
> >> http://www.mvps.org/access
> >> http://www.accessmvp.com
> >>
> >> "Steve Newport" <(E-Mail Removed)> wrote in message
> >> news:6166E18C-1120-4627-A4DF-(E-Mail Removed)...
> >> > Sorry basic question but I am going around in circles.
> >> >
> >> > I have a simple supplier table with Supplier ID as key. I open a new
> >> > table
> >> > with a form in preparation to add a new record in the second table
> >> > (Contacts). Form opens OK and you can add entries but I want to copy
> >> > across
> >> > the Supplier ID so that it maintains the relationship. Tried several
> >> > ways
> >> > but
> >> > cant manage it.
> >> >
> >> > The VB behind the relevant button that opens the form reads:
> >> >
> >> > Private Sub CMD_AddContact_Click()
> >> > On Error GoTo Err_CMD_AddContact_Click
> >> >
> >> > Dim stDocName As String
> >> > Dim stSupplierID As String
> >> >
> >> > stDocName = "FRM_ContactsAdd"
> >> > stSupplierID = SupplierID
> >> >
> >> > DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal
> >> >
> >> > Exit_CMD_AddContact_Click:
> >> > Exit Sub
> >> >
> >> > Err_CMD_AddContact_Click:
> >> > MsgBox Err.Description
> >> > Resume Exit_CMD_AddContact_Click
> >> >
> >> > End Sub
> >> >
> >> > Which I have messed around with a bit. How should I be doing this?
> >> >
> >> > Many thanks
> >> >
> >> >
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Arvin Meyer [MVP]
Guest
Posts: n/a
 
      5th Jan 2008
As I look more carefully, there is. I copied and pasted your code which had
an extra argument, then added 1 more:

DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal, Me.[Supplier
ID]

Should be:

DoCmd.OpenForm stDocName, , , , acFormAdd, acWindowNormal, Me.[Supplier ID]
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Steve Newport" <(E-Mail Removed)> wrote in message
news:43405F4C-8D29-4352-8DC1-(E-Mail Removed)...
> Thanks. Done that but I get a "Compile error" saying "Wrong number of
> arguments or invalid property assignment".
>
> I have entered both sets of codes as described.
>
> Any ideas?
>
> "Arvin Meyer [MVP]" wrote:
>
>> No the first line of code is in the button on the first form that opens
>> the
>> second one. The second form's Open event, needs to read the OpenOrgs
>> that's
>> passed from form number 1.
>> --
>> Arvin Meyer, MCP, MVP
>> http://www.datastrat.com
>> http://www.mvps.org/access
>> http://www.accessmvp.com
>>
>> "Steve Newport" <(E-Mail Removed)> wrote in message
>> news:90983ABE-5A93-4EC2-A510-(E-Mail Removed)...
>> > Many thanks for that - its miore like I expected to do but I am a bit
>> > confused by the second part. The first piece of code I entered using
>> > the
>> > DoCmd.Openform was in the event for the button to press to open the
>> > second
>> > form.
>> >
>> > When you say the second forms Open event - exactly where do you mean?
>> > Isn't
>> > it the same block of code?
>> >
>> > "Arvin Meyer [MVP]" wrote:
>> >
>> >> If you use the last argument, called OpenArgs in the OpenForm Method,
>> >> you
>> >> can get what you want.
>> >>
>> >> DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal,
>> >> Me.[Supplier
>> >> ID]
>> >>
>> >> Now, in the second form's Open event use a line like:
>> >>
>> >> Me.txtSupplierID = Me.OpenArgs
>> >> --
>> >> Arvin Meyer, MCP, MVP
>> >> http://www.datastrat.com
>> >> http://www.mvps.org/access
>> >> http://www.accessmvp.com
>> >>
>> >> "Steve Newport" <(E-Mail Removed)> wrote in
>> >> message
>> >> news:6166E18C-1120-4627-A4DF-(E-Mail Removed)...
>> >> > Sorry basic question but I am going around in circles.
>> >> >
>> >> > I have a simple supplier table with Supplier ID as key. I open a new
>> >> > table
>> >> > with a form in preparation to add a new record in the second table
>> >> > (Contacts). Form opens OK and you can add entries but I want to copy
>> >> > across
>> >> > the Supplier ID so that it maintains the relationship. Tried several
>> >> > ways
>> >> > but
>> >> > cant manage it.
>> >> >
>> >> > The VB behind the relevant button that opens the form reads:
>> >> >
>> >> > Private Sub CMD_AddContact_Click()
>> >> > On Error GoTo Err_CMD_AddContact_Click
>> >> >
>> >> > Dim stDocName As String
>> >> > Dim stSupplierID As String
>> >> >
>> >> > stDocName = "FRM_ContactsAdd"
>> >> > stSupplierID = SupplierID
>> >> >
>> >> > DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal
>> >> >
>> >> > Exit_CMD_AddContact_Click:
>> >> > Exit Sub
>> >> >
>> >> > Err_CMD_AddContact_Click:
>> >> > MsgBox Err.Description
>> >> > Resume Exit_CMD_AddContact_Click
>> >> >
>> >> > End Sub
>> >> >
>> >> > Which I have messed around with a bit. How should I be doing this?
>> >> >
>> >> > Many thanks
>> >> >
>> >> >
>> >>
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
Steve Newport
Guest
Posts: n/a
 
      7th Jan 2008
Thanks. Seem to be getting closer now but it is now reporting another error
when opening the FRM_ContactsAdd form. It comes back and says "Compile Error:
Methof or data member not found". It then highlghts the txtSupplioerID
section of the command?

"Arvin Meyer [MVP]" wrote:

> As I look more carefully, there is. I copied and pasted your code which had
> an extra argument, then added 1 more:
>
> DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal, Me.[Supplier
> ID]
>
> Should be:
>
> DoCmd.OpenForm stDocName, , , , acFormAdd, acWindowNormal, Me.[Supplier ID]
> --
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
> "Steve Newport" <(E-Mail Removed)> wrote in message
> news:43405F4C-8D29-4352-8DC1-(E-Mail Removed)...
> > Thanks. Done that but I get a "Compile error" saying "Wrong number of
> > arguments or invalid property assignment".
> >
> > I have entered both sets of codes as described.
> >
> > Any ideas?
> >
> > "Arvin Meyer [MVP]" wrote:
> >
> >> No the first line of code is in the button on the first form that opens
> >> the
> >> second one. The second form's Open event, needs to read the OpenOrgs
> >> that's
> >> passed from form number 1.
> >> --
> >> Arvin Meyer, MCP, MVP
> >> http://www.datastrat.com
> >> http://www.mvps.org/access
> >> http://www.accessmvp.com
> >>
> >> "Steve Newport" <(E-Mail Removed)> wrote in message
> >> news:90983ABE-5A93-4EC2-A510-(E-Mail Removed)...
> >> > Many thanks for that - its miore like I expected to do but I am a bit
> >> > confused by the second part. The first piece of code I entered using
> >> > the
> >> > DoCmd.Openform was in the event for the button to press to open the
> >> > second
> >> > form.
> >> >
> >> > When you say the second forms Open event - exactly where do you mean?
> >> > Isn't
> >> > it the same block of code?
> >> >
> >> > "Arvin Meyer [MVP]" wrote:
> >> >
> >> >> If you use the last argument, called OpenArgs in the OpenForm Method,
> >> >> you
> >> >> can get what you want.
> >> >>
> >> >> DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal,
> >> >> Me.[Supplier
> >> >> ID]
> >> >>
> >> >> Now, in the second form's Open event use a line like:
> >> >>
> >> >> Me.txtSupplierID = Me.OpenArgs
> >> >> --
> >> >> Arvin Meyer, MCP, MVP
> >> >> http://www.datastrat.com
> >> >> http://www.mvps.org/access
> >> >> http://www.accessmvp.com
> >> >>
> >> >> "Steve Newport" <(E-Mail Removed)> wrote in
> >> >> message
> >> >> news:6166E18C-1120-4627-A4DF-(E-Mail Removed)...
> >> >> > Sorry basic question but I am going around in circles.
> >> >> >
> >> >> > I have a simple supplier table with Supplier ID as key. I open a new
> >> >> > table
> >> >> > with a form in preparation to add a new record in the second table
> >> >> > (Contacts). Form opens OK and you can add entries but I want to copy
> >> >> > across
> >> >> > the Supplier ID so that it maintains the relationship. Tried several
> >> >> > ways
> >> >> > but
> >> >> > cant manage it.
> >> >> >
> >> >> > The VB behind the relevant button that opens the form reads:
> >> >> >
> >> >> > Private Sub CMD_AddContact_Click()
> >> >> > On Error GoTo Err_CMD_AddContact_Click
> >> >> >
> >> >> > Dim stDocName As String
> >> >> > Dim stSupplierID As String
> >> >> >
> >> >> > stDocName = "FRM_ContactsAdd"
> >> >> > stSupplierID = SupplierID
> >> >> >
> >> >> > DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal
> >> >> >
> >> >> > Exit_CMD_AddContact_Click:
> >> >> > Exit Sub
> >> >> >
> >> >> > Err_CMD_AddContact_Click:
> >> >> > MsgBox Err.Description
> >> >> > Resume Exit_CMD_AddContact_Click
> >> >> >
> >> >> > End Sub
> >> >> >
> >> >> > Which I have messed around with a bit. How should I be doing this?
> >> >> >
> >> >> > Many thanks
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Arvin Meyer [MVP]
Guest
Posts: n/a
 
      13th Jan 2008
The text box for your field "Supplier ID" is misspelled.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Steve Newport" <(E-Mail Removed)> wrote in message
news:CBA90A82-C300-4D13-BAA7-(E-Mail Removed)...
> Thanks. Seem to be getting closer now but it is now reporting another
> error
> when opening the FRM_ContactsAdd form. It comes back and says "Compile
> Error:
> Methof or data member not found". It then highlghts the txtSupplioerID
> section of the command?
>
> "Arvin Meyer [MVP]" wrote:
>
>> As I look more carefully, there is. I copied and pasted your code which
>> had
>> an extra argument, then added 1 more:
>>
>> DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal, Me.[Supplier
>> ID]
>>
>> Should be:
>>
>> DoCmd.OpenForm stDocName, , , , acFormAdd, acWindowNormal, Me.[Supplier
>> ID]
>> --
>> Arvin Meyer, MCP, MVP
>> http://www.datastrat.com
>> http://www.mvps.org/access
>> http://www.accessmvp.com
>>
>> "Steve Newport" <(E-Mail Removed)> wrote in message
>> news:43405F4C-8D29-4352-8DC1-(E-Mail Removed)...
>> > Thanks. Done that but I get a "Compile error" saying "Wrong number of
>> > arguments or invalid property assignment".
>> >
>> > I have entered both sets of codes as described.
>> >
>> > Any ideas?
>> >
>> > "Arvin Meyer [MVP]" wrote:
>> >
>> >> No the first line of code is in the button on the first form that
>> >> opens
>> >> the
>> >> second one. The second form's Open event, needs to read the OpenOrgs
>> >> that's
>> >> passed from form number 1.
>> >> --
>> >> Arvin Meyer, MCP, MVP
>> >> http://www.datastrat.com
>> >> http://www.mvps.org/access
>> >> http://www.accessmvp.com
>> >>
>> >> "Steve Newport" <(E-Mail Removed)> wrote in
>> >> message
>> >> news:90983ABE-5A93-4EC2-A510-(E-Mail Removed)...
>> >> > Many thanks for that - its miore like I expected to do but I am a
>> >> > bit
>> >> > confused by the second part. The first piece of code I entered using
>> >> > the
>> >> > DoCmd.Openform was in the event for the button to press to open the
>> >> > second
>> >> > form.
>> >> >
>> >> > When you say the second forms Open event - exactly where do you
>> >> > mean?
>> >> > Isn't
>> >> > it the same block of code?
>> >> >
>> >> > "Arvin Meyer [MVP]" wrote:
>> >> >
>> >> >> If you use the last argument, called OpenArgs in the OpenForm
>> >> >> Method,
>> >> >> you
>> >> >> can get what you want.
>> >> >>
>> >> >> DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal,
>> >> >> Me.[Supplier
>> >> >> ID]
>> >> >>
>> >> >> Now, in the second form's Open event use a line like:
>> >> >>
>> >> >> Me.txtSupplierID = Me.OpenArgs
>> >> >> --
>> >> >> Arvin Meyer, MCP, MVP
>> >> >> http://www.datastrat.com
>> >> >> http://www.mvps.org/access
>> >> >> http://www.accessmvp.com
>> >> >>
>> >> >> "Steve Newport" <(E-Mail Removed)> wrote in
>> >> >> message
>> >> >> news:6166E18C-1120-4627-A4DF-(E-Mail Removed)...
>> >> >> > Sorry basic question but I am going around in circles.
>> >> >> >
>> >> >> > I have a simple supplier table with Supplier ID as key. I open a
>> >> >> > new
>> >> >> > table
>> >> >> > with a form in preparation to add a new record in the second
>> >> >> > table
>> >> >> > (Contacts). Form opens OK and you can add entries but I want to
>> >> >> > copy
>> >> >> > across
>> >> >> > the Supplier ID so that it maintains the relationship. Tried
>> >> >> > several
>> >> >> > ways
>> >> >> > but
>> >> >> > cant manage it.
>> >> >> >
>> >> >> > The VB behind the relevant button that opens the form reads:
>> >> >> >
>> >> >> > Private Sub CMD_AddContact_Click()
>> >> >> > On Error GoTo Err_CMD_AddContact_Click
>> >> >> >
>> >> >> > Dim stDocName As String
>> >> >> > Dim stSupplierID As String
>> >> >> >
>> >> >> > stDocName = "FRM_ContactsAdd"
>> >> >> > stSupplierID = SupplierID
>> >> >> >
>> >> >> > DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal
>> >> >> >
>> >> >> > Exit_CMD_AddContact_Click:
>> >> >> > Exit Sub
>> >> >> >
>> >> >> > Err_CMD_AddContact_Click:
>> >> >> > MsgBox Err.Description
>> >> >> > Resume Exit_CMD_AddContact_Click
>> >> >> >
>> >> >> > End Sub
>> >> >> >
>> >> >> > Which I have messed around with a bit. How should I be doing
>> >> >> > this?
>> >> >> >
>> >> >> > Many thanks
>> >> >> >
>> >> >> >
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating RAS Entry Prashant Bhure Microsoft Dot NET Compact Framework 1 11th Nov 2008 11:45 AM
Creating RAS Entry Marc S Microsoft Dot NET Compact Framework 10 1st Sep 2006 06:27 PM
Creating an Autocorrect entry PT Microsoft Word New Users 1 28th Aug 2004 03:31 AM
Creating a new entry in a subform Dan Cole Microsoft Access Getting Started 2 19th May 2004 02:36 AM
creating entry in 2 tables joan Microsoft Access Form Coding 6 12th Jan 2004 11:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:42 PM.