Updating Table from Query - HELP !!!!!!!!!!!!!!

L

lalexander

How do I go about updating a new value in a table using a query
I want to update the table - and not the Form.

I have 2 tables

1. CLIENT - Field : ClientID < Autonumber>
(Other field are not important )

2. INFORMAL - Field : ID <Autonumber>
Field : REFNO <Number>

This is the scenario:
When I create a new client in a form I want to
save the REFNO of the Client and then
pass that value to update my INFORMAL Table with this Value ( not the form )

I tried using the Macro but ran into problems.

Thanks
 
J

John W. Vinson

How do I go about updating a new value in a table using a query
I want to update the table - and not the Form.

I have 2 tables

1. CLIENT - Field : ClientID < Autonumber>
(Other field are not important )

2. INFORMAL - Field : ID <Autonumber>
Field : REFNO <Number>

This is the scenario:
When I create a new client in a form I want to
save the REFNO of the Client and then
pass that value to update my INFORMAL Table with this Value ( not the form )

I tried using the Macro but ran into problems.

Thanks

What's the purpose of the INFORMAL table? Does it contain any other data about
the client? If so, you can use a Form based on Client, with a Subform based on
Informal; use ClientID as the Master Link Field and REFNO as the Child Link
Field.

If INFORMAL contains only these two fields... why does the table need to exist
at all? What will you be doing with it that you can't do with the CLIENT
table, or a query on the client table?

John W. Vinson [MVP]
 
J

Jasmine

John ,
Thanks for the response.

Sometime you have to be creative in the design & implemenation of a system.
At any rate i've found a way around my problem which is - Updating of a
database
( but not by using a form - but by a query - i've posted the code below )

Code:

Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("INFORMAL", dbOpenDynaset)
rs.AddNew
rs!INSURED = gxrefno()
rs.Update
rs.Close
Set rs = Nothing
Set db = Nothing

===============================================================
 

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


Top