Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NotInList Open Form from another database and update combo box

Status
Not open for further replies.

tadimil

Programmer
Aug 26, 2003
19
US
I've searched but can't seem to find what I'm looking for.
This is my first experience in working with two databases.
I have a Vehicle Maintenance program and an Inventory Program.
The Veh.Maint. has a form where the user can add parts used for a repair. If the part is not in the list it will open the form located in the Inventory Program. This form allows a new part to be added. So far...this works.

First, on NotInList, I'd like to populate the Inventory's "add" form when it opens with the value of the combo box on the "parts" form.

Second, after the part is added in the Inventory's "add" form, I'd like to update the combo box for the repair with the new part. Possibly correcting any upper/lower case. It would be nice to have each word's first letter in uppercase.

Currently:
It doesn't refresh the list and I have to close the repair form then open it up again and then the part will be in the list.

I've tried requery and refresh. Neither works or I'm not coding them correctly or in the right area.

I have a reference to the Inventory.mdb in the VehicleMaintenance.mdb
Each have their own front end/Seperate database to hold queries, macros, modules, forms and reports and back end/Seperate database to hold the tables only.

Thanks in advance!
 
Open the Inventory's "add" form modal (acDialog) and play with OpenArgs and NewData.
Then, instead of calling the Requery method you may try to reset the RowSource property of the combo.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Below is a function that is called by the NOTINLIST event on the parts form:

Public Function OpenUpdateForm()
FormOption = "Add"
DoCmd.OpenForm "UpdateItems", , , , , , NewData
End Function

The following is in the ONLOAD event of the Inventory "add" form:

If IsLoaded("AddEquipmentRepairParts") = True Then
Me.Description = Me.OpenArgs
End If

Me.Description is the field that I want to populate with the parts form that the user typed in.

Thanks again!
 
Forgot to mention...my last post does not work. Still need help...
Thanks
 
In the NotInList event procedure
DoCmd.OpenForm "UpdateItems", , , , acFormAdd, acDialog, NewData

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV,

I sure do appreciate your patience with me...but, that did not work...the field is still blank when the form opens.
It's like it doesn't see the combo box value on the parts form. I'm not sure.

Could it be something with the ONLOAD of the Inventory form?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top