Enter values in table from form using dlookup

S

s4

Hi,
Just wondering if it's possible to put values in a table, using data entered
on a form?
Like if the person enters for item a, 1, then it adds 1 to item A in a table.
I've tried dlookup(blah) = me.text1 but it doesn't work.
Thanks
 
F

Fred Boer

Dear s4:

What you want is the way it is supposed to work. You don't need to do a
lookup to move data from a form to a table, you simply need to "bind" your
form to the table (or a query based on the table). Every form has a "Record
Source" property; which should be the name of the table or query you want to
be the source of data on the form. Specifying your table in this property
"binds" the form to your table. You can then create controls (textboxes,
etc.), that display data from the table. Editing data in these controls
modifies the data in the table. No need for lookups!

If you are just starting out, you may want to try using the Wizard to build
some forms for you to see how this works - the Wizard works well in creating
basic forms.

HTH
 
S

s4

Thanks,
I've actually got a different form linked to the table, I was wanting to use
this form to enter amounts to ADD to the amounts already in the table. It's
basically a quantity thing.
Thanks
 
F

Fred Boer

Dear s4:

Depending on your needs, you could do this simply by having the form bound
to the table, and providing an unbound control (textbox, for example). The
user would enter the value to be added to the existing amount into this
unbound textbox. Then you could use a bit of code in the AfterUpdate event
to automatically add the amount to the table value, or you could create a
command button which would make the process one which requires the user to
click on a button.

Post back if this doesn't solve your problem!

Cheers!
 
B

Bob Quintal

Pardon me if my terminology is confusing: when I say "fields" I'm
referring to controls on a form which are either bound or unbound
to corresponding fields in the underlying table/query.

So why can't I just say "controls"? Well, my background is from
another database environment which didn't distinguish between
fields on a form and fields in the underlying table. When I first
read about "controls" in an Access textbook I thought it was very
odd terminology. I'm still adjusting.

Well those things on the form "control" what and how the data gets
into / out of the tables. :)

Q
 
P

pietlinden

Thanks,
I've actually got a different form linked to the table, I was wanting to use
this form to enter amounts to ADD to the amounts already in the table. It's
basically a quantity thing.
Thanks

why would you want to do it this way? BAD design. Use a query to
determine quantity on hand. Read Allen Browne's articel on his
website. www.allenbrowne.com it's in the solutions, Quantity on
Hand ..
 
Top