Access newbie needs help!!

Ben1642

New member
Local time
Today, 13:05
Joined
Mar 21, 2007
Messages
1
Hi,

I'm designing a database for work and am using buttons instead of the navigation features already standard with access.

I need some form of code?? for my button. I want a user to be able to click this button when finished entering data; access will then save the data, close the form and return the user to a main menu, like a switchboard.

Any suggestions or indeed code, lol, would be very helpful

Regards

Chris D
 
Is the form tied to a table/query, or is it a dummy form?
If the form is tied to a table/query, then the data should automatic update the table when you are finished entering.

As for closing the form.

DoCmd.Close
 
Reply

I'm also a newbiew too and have been doing some database development. I think if you investigate SQL INSERT statements with a unbound form this would do what you want with a macro associated to then result in a form oppening. I'll post a site which would help you later.

Build a form (unbound) with text boxes relating to fields in a table

EG FrmContact with text boxes such as contact names txtcontact etc etc

then open notepad to design you SQL statement like;

INSERT INTO TblOrders (QuoteID, CompanyID, StaffMemberID, Terms, PONumber, RDate) "- Table you are inserting into - not part of the code"
VALUES (QuoteID, CompanyID, SalesPerson, Terms, PON, txtRDate) "- Values From your Unbound form - not part of the code"

this is built into a macro SQL code and acan be followed by other functions such as opening forms.

(I think this is right, I'm a newbie too) :-) Have a look in general at my database which you can download which uses this quite a few times.
 
For starters, command buttons on bound forms can be created to do exactly everything you are describing - if the control wizards are enabled when you create the button. If the form is NOT bound to either a table (which I do not recommend anyway) or a query (which is recommended), you have to create a recordset underneath the form in its class module.
 

Users who are viewing this thread

Back
Top Bottom