command button

ngeng4

Registered User.
Local time
Tomorrow, 06:45
Joined
Feb 24, 2010
Messages
47
i have a command button on the form with the caption "add new record". i want the user to click that button then all the field in the form will turn blank. how can i do that?
 
In the VBA procedure write
DoCmd.GoToRecord , , acNewRec
 
In the button's click event use:

Code:
If Not Me.NewRecord Then
   DoCmd.RunCommand acCmdRecordsGoToNew
End If
 
I'm slow on the trigger tonight. :D
 
and another thing is, i have a text box with the project_id in the form. let say whenever a user type an id into that text box, then all the detail will appear. how can i do that?
 
and another thing is, i have a form with the field name project_id.
then whenever user insert an id, i want all the detail to be appear. how can i do that?
 
and another thing is, i have a form with the field name id, whenever a user fill in a certain id, then i want all the details be appear. how can i do that?
 
Although you can add buttons and things to move to the new record, it is important to understand that none of this is necessary.

just create a (bound) form based on one of your tables with the form creation wizard

at the bottom you will see navigation buttons. click the last button with the star - this will rtake you to a new record. If you want to find an existing record - click in any data field - name, address, phone number - anything. Then click the binoculars icon, and enter what you are looking for.

Simple

---------
Everything else you do modifies this basic behaviour, or maybe make this stuff slightly more accessible - but it is important to understand that this behaviour is at the centre of pretty well everything access does.

So You do not normally need a button to clear a record, or a text box to find a record
and in fact creating a text box, to navigate to a record is relatively advanced stuff

So the best thing is really to read through a general access primer, to get an understanding of access tables/forms/queries as a start.
 
urmm.. what i mean is, ok i have a combo box with a certain list. my user request for that combo box. but let say the user want to add new data to the combo box, it will save automatically. how to do that?
 
you can use the notinlist event to open an edit form to maintain the list

or treat the list mtce as completely separate, and either use a dble-click on the list or a separate button to requery the list

just
mycombobox.requery
 

Users who are viewing this thread

Back
Top Bottom