I have two tables, table 1 and table 2 (i'll keep this in simple english).
Table 1 contains contact details of customers while table two, contains the
ID No of the customer from the customer's table and the name from the
customers table, plus a load of other info entered by the user as the table
is filled (both tables are filled through simple forms). Now, here is my
problem.
When the user is filling in table 2 from its form, I would like to, after
the name is entered, have the ID No auto entered (as its value is in the ID
No in the customers table1) into the ID No field in table 2.
not one of the Access books i have, have read or consulted show how to do
this!
and if it's posible do i use a macro, expression or code to do it?
|
|
0
|
|
|
|
Reply
|
Utf
|
4/30/2010 7:07:01 PM |
|
This is most easily handled by using a main form bound to table1 and a
subform bound to table2. You set the link master/child properties to the ID
(primary key) field. This will automatically pass the ID value from the main
form to the subform.
--
Duane Hookom
Microsoft Access MVP
"Thanatosuk" wrote:
> I have two tables, table 1 and table 2 (i'll keep this in simple english).
> Table 1 contains contact details of customers while table two, contains the
> ID No of the customer from the customer's table and the name from the
> customers table, plus a load of other info entered by the user as the table
> is filled (both tables are filled through simple forms). Now, here is my
> problem.
>
> When the user is filling in table 2 from its form, I would like to, after
> the name is entered, have the ID No auto entered (as its value is in the ID
> No in the customers table1) into the ID No field in table 2.
> not one of the Access books i have, have read or consulted show how to do
> this!
> and if it's posible do i use a macro, expression or code to do it?
>
>
>
|
|
0
|
|
|
|
Reply
|
Utf
|
4/30/2010 7:26:06 PM
|
|
"Thanatosuk" <Thanatosuk@discussions.microsoft.com> wrote in message
news:6A666E87-1560-412D-928B-3832DF4D3A4A@microsoft.com...
>I have two tables, table 1 and table 2 (i'll keep this in simple english).
> Table 1 contains contact details of customers while table two, contains
> the
> ID No of the customer from the customer's table and the name from the
> customers table, plus a load of other info entered by the user as the
> table
> is filled (both tables are filled through simple forms). Now, here is my
> problem.
>
> When the user is filling in table 2 from its form, I would like to, after
> the name is entered, have the ID No auto entered (as its value is in the
> ID
> No in the customers table1) into the ID No field in table 2.
> not one of the Access books i have, have read or consulted show how to do
> this!
> and if it's posible do i use a macro, expression or code to do it?
Table 2 should not contain the name from the customers table, only the
customer ID. However, on the form for table 2, the Customer ID field should
be represented by a combo box whose rowsource is a query of the Customers
table. The query would return both ID and name, probably sorted by name.
The combo box would have these properties:
Column Count: 2
Column Widths: 0'; 2" (maybe)
Bound Column: 1
Control Source: CustomerID
(although the specific field name depends on what you named it in your
table.)
With this arrangement, the user will see and select customer names, but what
gets stored in the table is the ID.
--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html
(please reply to the newsgroup)
|
|
0
|
|
|
|
Reply
|
Dirk
|
4/30/2010 7:30:09 PM
|
|
test
"Thanatosuk" <Thanatosuk@discussions.microsoft.com> wrote in message
news:6A666E87-1560-412D-928B-3832DF4D3A4A@microsoft.com...
>I have two tables, table 1 and table 2 (i'll keep this in simple english).
> Table 1 contains contact details of customers while table two, contains
> the
> ID No of the customer from the customer's table and the name from the
> customers table, plus a load of other info entered by the user as the
> table
> is filled (both tables are filled through simple forms). Now, here is my
> problem.
>
> When the user is filling in table 2 from its form, I would like to, after
> the name is entered, have the ID No auto entered (as its value is in the
> ID
> No in the customers table1) into the ID No field in table 2.
> not one of the Access books i have, have read or consulted show how to do
> this!
> and if it's posible do i use a macro, expression or code to do it?
>
>
>
|
|
0
|
|
|
|
Reply
|
russ
|
4/30/2010 9:35:47 PM
|
|
If the forms are bound to the table, set the relationship between the two up
via parent and child fields and it would auto-update elseif the forms and
fields are not bound to any table or query, simply set the id field of form2
to the value of the id field of form1 as soon as any field on form2 is
updated.
"Thanatosuk" <Thanatosuk@discussions.microsoft.com> wrote in message
news:6A666E87-1560-412D-928B-3832DF4D3A4A@microsoft.com...
>I have two tables, table 1 and table 2 (i'll keep this in simple english).
> Table 1 contains contact details of customers while table two, contains
> the
> ID No of the customer from the customer's table and the name from the
> customers table, plus a load of other info entered by the user as the
> table
> is filled (both tables are filled through simple forms). Now, here is my
> problem.
>
> When the user is filling in table 2 from its form, I would like to, after
> the name is entered, have the ID No auto entered (as its value is in the
> ID
> No in the customers table1) into the ID No field in table 2.
> not one of the Access books i have, have read or consulted show how to do
> this!
> and if it's posible do i use a macro, expression or code to do it?
>
>
>
|
|
0
|
|
|
|
Reply
|
russ
|
4/30/2010 9:41:48 PM
|
|
|
4 Replies
275 Views
(page loaded in 0.065 seconds)
Similiar Articles: File in Exclusive Use - microsoft.public.excel.miscI have searched this forum and Excel help and cannot find the answer to my seemingly simple question. ... set access file to open in exclusive mode ... Import a PDF File into an Access 2007 Report - microsoft.public ...... to help people answer simple questions ... just browsing the access.public forums and gleaning information. Just think how much more time it takes to answer questions. adding a skip pattern - microsoft.public.access.formsIs there any relatively simple way to include skip patterns in an Access form? Example: if the answer to question 1 = no, then skip to question 6. Basic Question StringReader (ReadXML) - microsoft.public.crm ...to access it. (?) But i seems there is no logic connection ... public.dotnet.xml My question is simple if I'm ... StringReader? ... meant to answer with another question ... Uncheck all checkboxes - update query question - microsoft.public ...... from an Access document. Someone gave me this reply, but I have no idea how this works. Any ... to No (or false). And to answer your third-last question ... then a simple ... Simple question about competitors - microsoft.public.crm ...Create A Search Field on a Form - microsoft.public.access ..... Post Question Groups ... ... more productive through the exchange of short frequent answers to one simple question ... Access 2007: Where does database name display? - microsoft.public ...I just had Access 2007 installed on my computer. Simple question: where does a database's name display in ... Access 2007 - Display Database Name - Microsoft Answers If I ... Simple question re autotrim varchar - microsoft.public.sqlserver ...... and Ltrim with values - microsoft.public.access.queries ... Simple question re ... - Codewalkers... find an answer to what I think is a pretty simple question. Simple VBA crashes Access 2007, why? - microsoft.public.access ...... Post Question ... Simple VBA crashes Access 2007, why? - microsoft.public.access ... ... VBA Crashes Access - Microsoft Access Forums I couldn't ... How can I read CSV file using VBA? - microsoft.public.access ...... posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access ... You would have to write code to answer a simple question. How many tests were marked ... How To Ask Questions The Smart Way... reputation for meeting simple questions ... if you are sure your question is non-trivial, and you get no answer in the “ user ” list/forum for ... I'd need hands-on access to ... Home - Microsoft AnswersForums. Hotmail, Messenger & SkyDrive; Internet Explorer; Office; Office for Mac ... Find answers Ask a question Answers - The Most Trusted Place for Answering Life's QuestionsPromoted questions; Community forum; Unanswered questions; Advanced search; Top contributors ... Answer put ice on the wax. it will harden and crack off. when I wax ... Yahoo! Answers - HomeYahoo! Answers is a new way to find and share information. You can ask questions on any topic, get answers from real people, and share your insights and experience. Questions & Answers | ChaChaGet human-powered answers to any question - anytime, anywhere, all for free - on the web and through your mobile phone by texting 242-242... 7/16/2012 5:39:43 PM
|