PDA

View Full Version : Userform in Access - help with command button



JohnnyBravo
06-23-2006, 12:01 PM
I've created a userform in Access 2003. Now I'm relatively new to creating forms so I need a little help. Basically, after entering the last piece of information in the form, I want to give the user a command button so he can click to save and enter a new record. OR: Maybe a better option is to have it automatically save and go to next record upon exiting the last field in the form.

Since I'm so new to creating forms I don't know which is the best option. Any advice?

OBP
06-23-2006, 12:32 PM
If you have the normal "Navigation Buttons" marked as yes the user can go to a new record using the "*" new record button. The record is automatically saved. You can mark the Navigation Buttons as "no" and create your own buttons to do the same things, but why bother?

CFDM
06-23-2006, 01:07 PM
As long as it is a bound form, it saves automatically. Put a command button with the wizzard if you need to just reassure them that it was saved.

JohnnyBravo
06-23-2006, 01:08 PM
OK, I see what you mean now. Alright now I've got a different problem. The userform that i've set up seems like it's not tied to anything. Basically it's for entering invoices that we have to pay. So it's got fields for the Vendor Name; Invoice Amount; Invoice Date; What the expense was for, etc.

When I enter in the information, I can type into the respective fields, but it does not take that data and add it to the Vendor table. This is my first time building a form in Access so bear with me. Obviously I'm missing a step here. How do I get it to add the new records to the table?

CFDM
06-23-2006, 01:12 PM
It seems like you have an unbound form. You have to use an SQL INSERT into "tblname" statement. If you want it bound, make sure the record source is linked to the table you want.

GaryB
06-23-2006, 03:39 PM
how about making a query from the table ( which will give you other options later) and using the query as the data source? That should allow the form to add to the table.

Gary

JohnnyBravo
06-25-2006, 01:42 PM
how about making a query from the table ( which will give you other options later) and using the query as the data source? That should allow the form to add to the table.

Gary

Thanks Gary. I'll have to work on that option as I think CFDM's advice is too advanced for me. I'm very much an Access newbie. It's the weekend right now so tomorrow when I head back into the office, I will work on this and come back with more questions I'm sure.