Help with auto filling fields on a form (1 Viewer)

kez

New member
Local time
Tomorrow, 08:20
Joined
Nov 4, 2005
Messages
9
Hi I am a real novice at code but was wondering if anyone could help.
I have a from called Forms Request with the following fields: Client (Combo Box), Address, Suburb, State, Post Code etc...
I also have a table called Client with the following fields: Client Id:, Client:, Street Address:, Suburb, Post Code etc....
What I want to achieve is when the Forms Request form is open and after Client field has been updated to have the Address Field, Suburb, State & Postcode (from the Client Table) to automatically fill in these fields. Is this possible???? I originally had a combo box for all these fields but as we have approx 3,000 clients to choose from it takes a long time to select.

Many Thanks in advance for your help. :confused:
 

kez

New member
Local time
Tomorrow, 08:20
Joined
Nov 4, 2005
Messages
9
Auto Fillin Fields

Thanks that was a really big help and it worked in his example - But I couldn't get it to work for my form. His example only used 1 table and one form based on that table. I have two tables and one form. I have a main table with client name and a second table with a combo box linked to the main table "client name". In Allen Browne's tips he says to leave ther combo's RowSource property blank - this is where I think my trouble is.

I am stuggling with this one how do I reference in my code the client name to go to the main table.

As I said I am a big novice and your help is greatly appreciated.
 

RuralGuy

AWF VIP
Local time
Today, 16:20
Joined
Jul 2, 2005
Messages
13,826
Have you implemented Allen's code? I don't think I understand your problem. Can you post your mdb, or at least enough of it to demonstrate the problem with sample data.
 

kez

New member
Local time
Tomorrow, 08:20
Joined
Nov 4, 2005
Messages
9
Many Thanks for taking the time to help.

I've attached a test mdb for you - similar to what I am currently using (without additional fields of course).
 

Attachments

  • Test.zip
    23.1 KB · Views: 105

RuralGuy

AWF VIP
Local time
Today, 16:20
Joined
Jul 2, 2005
Messages
13,826
Hi Kez,

Here's the mdb back after I made some changes. See if it does what you want done. It really helps if you put Option Explicit as the second line in the code module. There were several typo's that it caught. Let me know if you have additional questions.
 

Attachments

  • Test1.zip
    20.9 KB · Views: 166

kez

New member
Local time
Tomorrow, 08:20
Joined
Nov 4, 2005
Messages
9
YOU ARE A GENIUS this works great and has made my database much more foolproof so THANK YOU very very much.
Kez
 

Users who are viewing this thread

Top Bottom