View Single Post
  #2  
Old February 5th, 2010, 04:18 PM posted to microsoft.public.access.tablesdbdesign
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default Unbound Data Entry Form

Steve,
Given cboSupplierID with SupplierID in the first column, and
SupplierName in the second column.
Setup your combobox like this...
No Of Columns = 2
Column Widths = 0" ; 1.5"

This allows the user to only see the SupplierName, select a
SupplierName, but
set the value of cboSuppplierID to the SupplierID. I think that's what you
want...
(usually, the cboSupplierID would be "bound" to your SupplierID table
field)

On my website (below) I have a sample A97 and A2003 zip file named
Combo Quick Find, which demonstrates the above method.
--
hth
Al Campagna
Microsoft Access MVP 2006-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"Steve Muir" wrote in message
...
Bit of a "noob" question but here goes....

I am using an unbound form for data entry purposes. I am using an unbound
form as I have some VBA code which checks that mandatory fields are filled
in
first.

This works fine where all the fields are text boxes (i.e. not combos or
list
boxes)
but the problem I'm having is that the parent table "tblContracts" has 4
lookup tables (which are used for combos with various fields on the form)
and
these are numeric fields which link between the tables (i.e. In the parent
table the field would be SupplierID whick links to the child table
SupplierID
field) In the form obviously it displays the actual name rather than the
index numerical value when the user clicks the dropdown menu. The issue
(I
think?) is that the VBA code I have is trying to insert a numerical value
(The ID field value) rather than the text which is displayed in the
dropdown
menu. How can I get round this??

Apologies if this seems really simple but I have limited VBA coding
experience. The

PS - VBA code to insert data to the table works perfectly if the table has
no lookup values in the combo boxes.

These ar

When I click the command button to insert the data from the form into the
table