J G
asked on
Combo Box with a control source is "locked"
I have a Navigation form with 2 continuous sub forms.
PLU is the common key field
1 sub-form (sub_vendor_item) is for entering vendors, order numbers, and costs - with a corresponding table called tbl_vendor_item.
1 sub-form (sub_store_item) is for entering retail prices based upon the vendors, order numbers, and costs entered in the first sub-form. This sub-form will have a corresponding table called tbl_store_item. In tbl_store_item, I added additional fields called current vendor, current cost, and current order code which will in effect enable write to tbl_store_item the combo box row-source selections which are fetched from tbl_vendor_item.
I have been able to get the store_item vendor combo box to populate correctly, however when I try to select a value from the combobox it will not populate the form field or write to the tbl_store_item. Combobox Control Source is set to current vendor. Combobox row source is set to a tbl_vendor_item query. Access also gives me a chime when I try to make the selection.
What is locking the combobox? How can I get this to work?
When I add a control source to my form combobox it greys out the combo box choices and will not update bound the form field.
PLU is the common key field
1 sub-form (sub_vendor_item) is for entering vendors, order numbers, and costs - with a corresponding table called tbl_vendor_item.
1 sub-form (sub_store_item) is for entering retail prices based upon the vendors, order numbers, and costs entered in the first sub-form. This sub-form will have a corresponding table called tbl_store_item. In tbl_store_item, I added additional fields called current vendor, current cost, and current order code which will in effect enable write to tbl_store_item the combo box row-source selections which are fetched from tbl_vendor_item.
I have been able to get the store_item vendor combo box to populate correctly, however when I try to select a value from the combobox it will not populate the form field or write to the tbl_store_item. Combobox Control Source is set to current vendor. Combobox row source is set to a tbl_vendor_item query. Access also gives me a chime when I try to make the selection.
What is locking the combobox? How can I get this to work?
When I add a control source to my form combobox it greys out the combo box choices and will not update bound the form field.
check the row source of the combo, make sure that the bound column item does not have duplicate values.
It is hard to debug stuff like this without a working copy of the app but the locking is usually caused by an invalid RowSource query or a property setting that conflicts with the RowSource.
If you are not familiar with the various property settings, the easiest thing is usually to delete the combo and add it back. If that doesn't resolve the problem, look at the query.
If you are not familiar with the various property settings, the easiest thing is usually to delete the combo and add it back. If that doesn't resolve the problem, look at the query.
ASKER
Attached is a sample DB.
the main form is item_master. If you click on PLU 00000003028 in the datasheet you will see sample data in the 2 navigation sub forms.
The end goal would be to be able to select a different vendor for each store if necessary.
C--Users-josht-Desktop-EE.accdb
the main form is item_master. If you click on PLU 00000003028 in the datasheet you will see sample data in the 2 navigation sub forms.
The end goal would be to be able to select a different vendor for each store if necessary.
C--Users-josht-Desktop-EE.accdb
ASKER
This db has current vendor as record source. The previous version did not.
C--Users-josht-Desktop-EE.accdb
C--Users-josht-Desktop-EE.accdb
your combo is locked by this codes, (comment the line Call LockControls(Me, True)) and test
Private Sub Form_Current()
bLocked = False
Call AlterButton
Call LockControls(Me, True)
Me.SearchField.SetFocus
End Sub
also, use this as the rowsource of the combo
SELECT tbl_Cat_Sub.CatSub, tbl_Cat_Sub.CatSubName
FROM tbl_Cat_Sub
WHERE (((tbl_Cat_Sub.Available)= False));
Private Sub Form_Current()
bLocked = False
Call AlterButton
Call LockControls(Me, True)
Me.SearchField.SetFocus
End Sub
also, use this as the rowsource of the combo
SELECT tbl_Cat_Sub.CatSub, tbl_Cat_Sub.CatSubName
FROM tbl_Cat_Sub
WHERE (((tbl_Cat_Sub.Available)=
ASKER
I think your looking at the wrong combo. It is the combo box in the Navigation sub form "Store Pricing" Tab
I'm not sure what you think you gain by using a navigation form as a subform. I think it is complicating your issue. You could just use a tab control and put a subform on each tab page. At least that way, you can use the Master/Child links and Access will help you by populating the foreign keys. I can't say that the navigation subform is causing a problem, only that it is making debugging harder.
It looks like you are trying to set the store name to PLU which is wrong. Perhaps if you fix that, it, it will work.
PS - uploading a database with no instruction on how to recreate the problem, wastes our time.
It looks like you are trying to set the store name to PLU which is wrong. Perhaps if you fix that, it, it will work.
PS - uploading a database with no instruction on how to recreate the problem, wastes our time.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry!
instructions would be:
open Item_Master
in data sheet select PLU 00000003028
click Vendor Costs to see added cost records
click Store Pricing then vendor Combo to add a vendor that was setup in Vendor Costs for PLU 00000003028
Why is trying to set the store name to PLU wrong?
instructions would be:
open Item_Master
in data sheet select PLU 00000003028
click Vendor Costs to see added cost records
click Store Pricing then vendor Combo to add a vendor that was setup in Vendor Costs for PLU 00000003028
Why is trying to set the store name to PLU wrong?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.