8 hrs working on it and wont work

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

Guest

I am a new to Access. I have been working on trying what should be a simple
task. I have read and re-read multiple post on this, but cannot get anything
to work right. I simply want to have an account number fill in (to a text
box) after selecting a company name from a combo box, and for that to save to
a table. I have tried a table with two fields (company name, acct #'s). I
have tried using them as two differnt tables. I have tried the: =company
name.column(1) in the control box. This cannot be this hard even for a
novice. Please help....Thanks in advance.
 
JRibs,
No need to store the AcctNo in a separate text control, the combo can do "double duty"

Set up your combo box this way...
First Column = AcctNo SecondColumn = CompanyName (sort on CompanyName Asc)
Bind the Combo box to your AcctNo field in your form table.
ColumnCount = 2
ColumnWidths = 0"; 1.5"
ListWidth = 1.5"

When you drop down the combo, you'll see a list of CompanyNames, (because the AcctNo
column is being hidden), and when you select a Company, it will show that Name in the
Combo.
BUT... what's really happening is that the AcctNo (hidden) will store itself in the
bound AcctNo field. The combo "displays" the first "visible" column, but stores the first
column (column(0)) in the field.
So the user is insulated from AcctNos and selects by Name, but you're really capturing
the AcctNo.
 
Al,
Thanks for your help. That worked! However is there any way I can get it
so that it captures the Company name (from Combo) and the Acct # (from text)
in to my table?

Thanks again.
JR
 
Al,
Thanks for your help. That worked! However is there any way I can get it
so that it captures the Company name (from Combo) and the Acct # (from text)
in to my table?

You don't WANT to do this.

Access uses the "Grandmother's Pantry Principle": "a place - ONE
place! - for everything, everything in its place". The company name
should be stored in the Company table and ONLY in the company table;
your other tables should have only a link (the Acct # I presume) to
this table. Storing the company name redundantly wastes space and,
worse, risks data integrity; if "Acme Widgets Inc." changes its name
to "Global Eclectic Supply Co." you will need to track down and change
EVERY SINGLE PLACE it's been entered. Better is to just store it
*once* and use Combo Boxes or Queries to link to the name as needed.

John W. Vinson[MVP]
 
Jribs,
I see that John Vinson has you covered on this one.
From the CustomerNo you captured, you can always re-derive the Customer Name, Address,
Zip... etc.. "on the fly", via that CustNo... in any subsequent query, form, or report.
 
sometimes-- like with slowly changing dimensions-- you do want to store
the historical name for the company.

database rules are meant to be broken.
in general; when everyone is saying 'do this; dont do this' you need to
learn to take it with a grain of salt.

disregard anyone in this mdb forum; mdb is crap and anyone here is too
stupid to know a real db like SQL Server
 
From this and other posts I suspect you're just a troll, but there is the
possibilty that you're actually incompetent and prefer to blame the tool.

There are more bad databases out there caused by people breaking the rules
than by people sticking to them so again you offer advice which is
essentially wrong.
 
Back
Top