Need to enter repetative data in Access 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to find a way to have this argument automated IF 123 (in field 2) THEN
ABC (in field 12). I deal with a lot of the same customers and would like to
have Access fill in the Custimer Name field in my fom once I key in the
unique Customer ID #. I need to set this up for approximately 50 customers.
Any and all assistance is appreciated, especially since I am new to Access
 
you need to use a DLookUp function. Here is a sample from something I do:
Text31.Value = DLookup("name", "tblemployee", "[badge #] = '" & Text32 & "'")
 
Thank you so much for the rapid response! I will follow up on learning how
to do this also. However, is this something an expression builder will do
also? Again, thank you for your patience in answering my VERY basic
questions.
--
SoftRound56


Mike said:
you need to use a DLookUp function. Here is a sample from something I do:
Text31.Value = DLookup("name", "tblemployee", "[badge #] = '" & Text32 & "'")

SoftRound56 said:
I need to find a way to have this argument automated IF 123 (in field 2) THEN
ABC (in field 12). I deal with a lot of the same customers and would like to
have Access fill in the Custimer Name field in my fom once I key in the
unique Customer ID #. I need to set this up for approximately 50 customers.
Any and all assistance is appreciated, especially since I am new to Access
 
SoftRound,

Basically, you should not be entering the Customer Name into the main
table that the form is based on. The Customer ID would be the field
that links this table to the master Customer table. So what you really
need is for the Customer Name to be "displayed" on the form.

In these instances, it is common to use a combobox to enter the customer
to the form. It is also common (this may or may not apply to your
requirements) for the ID number to be meaningless, apart form providing
uniqueness, and so not shown on the form at all.

Anyway, there are several ways of doing this. Some of them are
discussed in this article...
http://accesstips.datamanagementsolutions.biz/lookup.htm

Please get back if you need further help with this.
 
Mike,

A few comments, if I may...

This is a line of VBA code, not a macro.

Doing something like this would generally indicate a flaw in your table
design.

'Name' is a Reserved Word (i.e. has a special meaning) in Access, and as
such should not be used as the name of a field or control.

It is not a good idea to use a # as part of the name of a field.
 
I have adressed a similar issue by creating two tables. One with the Customer
Data with a one-to-many relationship to a table containing the customer
transactions. The Customer ID is the primary key in the firts table. Create a
query from the two tables and base all forms and reports on this querry. Use
a combo box to select the customer ID on the form, use the values on the
Customer Details for the combo-box.. By not limiting the combo box to the
valueson the table, I am able to capture transactions for "once-off"
customers not included in my Customer Details Table.

Ihave gone further with an append querry to append "once-off" customer
details from the Transactions table to the Customer Details Table if I see
repeat orders.

Note Steve's advice on the use of reserved words, I learned this one the
hard way.
I am no expert on DLookup, but I read in this forum that it's generally
better to use queries. These are definately quicker to build.
 
I thank you all for your assistance. I think part of the problem is that I
may have to much information in my original table and am trying to not
duplicate the information. Most likely an imperfect understanding of data
bases on my part. Again, thanks to each of you whom responded.
 
Back
Top