Write to a table

  • Thread starter Thread starter Kou Vang
  • Start date Start date
K

Kou Vang

I am trying to write to a table from a form. I have 2 txtboxes and 1 listbox
with values I would like to write to a table. I couldn't use an append
query, as my numeric expression in my listbox was too complex. I find it
ridiculous that I have to use ADO or DAO to write the one field that can't be
written because listboxes can't contain numerals? So am I basically stuck
with having to use ADO to write to the table? Perhaps writing to a textfile
is easier? Thanks.

Kou
 
I am trying to write to a table from a form. I have 2 txtboxes and 1
listbox
with values I would like to write to a table. I couldn't use an append
query, as my numeric expression in my listbox was too complex. I find it
ridiculous that I have to use ADO or DAO to write the one field that can't
be
written because listboxes can't contain numerals?

I am not aware of the above restriction at all.

When you build the list box, what is the source for the items in the list
(are you using a built in "value" list, or sql???).

Furthermore, careful as what column you bind (and, while we at this...is the
listbox multi-column...or single column?).

You can (and should) simply bind that listbox to a field of the forms data
source. Careful, you need to set the correct data type if you are in fact
storing a number field, or perhaps a text value that you select from the
lsitbox (or, you might in fact be storing an id, and displaying the text).

Of course, only going to be able to bind one value from the list box to the
underlying data field, as you can't "stuff" more then one value into a
field.

Have you tried building the list box via the wizard...
 
Kou Vang said:
I am trying to write to a table from a form. I have 2 txtboxes and 1 listbox
with values I would like to write to a table. I couldn't use an append
query, as my numeric expression in my listbox was too complex.

This doesn't make a lot of sense. Just what was too complex? Could
you post the code or whatever that numeric expression was?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
It was just a simple expression.

expr1: val([forms]![forms1]![lstbox1])

I used this in one of the fields for my append query, thus getting that my
numeric expression was too complex? I was suprised to say the least. I had
a similiar numeric expression but for a txtbox, and it evaluated just fine,
plus the txt box was bounded as my listbox was unbounded. It would be great
if someone else could try and see if they also get an error for the numeric
expression being too complex.

Kou
 
Back
Top