Possible Query??

cornishteeth

Board Regular
Joined
Dec 6, 2002
Messages
117
I have a table named tblEmployees that essentially lists all my employees. I want the ability to Enter new employees on my main form. Kind of like a command button or textbox that sends that info to the table, but leaves the other "stuff" in there. Now to do this I think I need to create a query that adds this name to the list of individuals I already have or some sort of update query. I tried a lot of things, but nothings working. Any help would be appreciated.

Frank
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
On the left bottom of your form, there should be record selection keys (right and left pointing arrows). They last arrow should be an arrow with an asterisk. If you click on this, you can enter a new record which will automatically add to your table.
 
Upvote 0
What I'm actually looking for is the ability to update from a form. I have a main table tblMain and an Employee table tblEmployee. The employee table is used as a drop down box in various places in my forms. Instead of supervisors going into "nitty gritty" of the database, I want them to have the ability to update tblEmployee from the main form.
 
Upvote 0
Here is one way to handle this:

1. Create a new form of employee information (based solely on the Employee Table).
2. Place a command button on your main form, something like "Add/Edit Employees".
3. Attach the code to this command button to open the employee form created in step 1.
4. In order to get your main form to recognize these additions, you will need to Requery your Form on re-entering it. This can be done by placing the requery code in the Activate event of the main form, something like:

Code:
Private Sub Form_Activate()

'   Requery data
    Forms![frm Main Form].Requery

End Sub
 
Upvote 0
In the drop down box set LimitToList to yes.

Then in the NotInList event you can put code to add a new record to the Employees table.
 
Upvote 0

Forum statistics

Threads
1,221,699
Messages
6,161,367
Members
451,700
Latest member
Eccymarge

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top