PDA

View Full Version : [SOLVED:] Strange behavior VB editor



TonC
07-15-2017, 03:08 PM
Hello,:banghead:


In my DB, is a form named “frmWareHouse”, in that form is a subform that has the name “subfrmWareHouse”.

When I look in the VBA editor, at my code then the editor sees the name of the subform with a capital first letter.
The editor says “SubfrmWharehouse” but my formname is just “subfrmWhareHouse”.

I looked for a solution to solve this problem, but cannot find it. Its creates al lot of error messages.

When I try to change de first capital letter, into a small letter, and I click in the procedure somewhere else, then
the first letter jumps automatically back to a capital letter.

Forms!frmWareHouse!SubfrmWhareHouse.requery (acces cannot find the form).

The correct code is off course

Forms!frmWareHouse!subfrmWhareHouse.requery

Any help would be gratefull,
Greetings,
TonC

SamT
07-15-2017, 04:30 PM
Don't argue with the VBE... Change the Sub Form name to a Cap letter

Or try completely different names...MasterFormWarehouse, Master_WarehouseForm, Sub_warehouseForm, WareHouseSubForm, frmWarehouseSubForm, frmWarehouseMaster...

TonC
07-15-2017, 11:40 PM
Okay, good advice

But I have also another form, with the similar names, and there sees the VBE the proper names of the forms. Its not logical to make a difference in the names of the forms.
I will not argue with the VBE.

Thanks for the help

SamT
07-16-2017, 06:29 AM
I suspect that somewhere in the code is a reference to "SubfrmWhareHouse."
You might try, First temprarilychange the Form Name to not be referable, such as XSubXfrmWhareHouse

Then Using Ctrl+H, Find and Replace all instances "in the Project" From "SubfrmWhareHouse," Ignore Case, to subfrmWhareHouse.

Finally,rename "XSubXfrmWhareHouse" itself back to subfrmWhareHouse

TonC
07-21-2017, 05:04 AM
Hello SamT,

I must make my apologies, because the problem was caused by myself. The form name was an old form name and not the new form name. It makes me more attentive for the future to look carefull at my vba code and the associated form names.

But anyway,
Thank you very much for trying help.

SamT
07-21-2017, 06:50 AM
YW. That's what we live for.