Apply One Event Procedure to Multiple Textboxes
What I have is a form with 21 sets of textboxes, each set represents an item. The goal is to have the item information populate in the other textboxes of that set after the item number has been updated. The boxes are named as follows txt_ItemNum_#, txt_Description_# where # is a number from 1 to 21 that identifies the set.
I can write the procedure and all, but I'm hoping there is a more efficient way than creating 21 seperate events
Thank you for taking the time to report an issue.
What's wrong... Please write below.
The subform combo box also has a Dlookup procedure on "after update" event that has a criteria on what the AutoFill procedure will populate based on the mainform textboxes that is AutoFilled by a mainform combo box.
Everything works fine, until I change the value of the Mainform combobox, which changes the value of the textboxes on the mainform from which the Subform combobox gets its criteria for the Dlookup procedure.
My problem is that the Subform combobox does not re-populates the subform textboxes when I change the value of the mainform combobox. I still need to select the same item in the subformcombobox list to initiate the AutoFill procedure of the subform textboxes.
I have tried a function and a sub, but within the code module associated with the form, and I have tried both a function and a sub within a standard module, but none of these seem to work the way I'm doing it.
Of course, if this is not possible, I can have each [Event Procedure] call my own procedure, but I was hoping there was a way to just call my procedure from the Event tab in the properties window
This all must be done with VBA and I do not have the option of making the event procedure the typical way because the form is created on the spot with
It seems like the file is no longer trusted and the functions are locked in some way, however I have checked the trusted files location and it is correct.
I get the following error message on every event that runs:
The expression On (all events) you entered as the event property setting produced the following error: Procedure declaration does not match description of event or procedure having the same name.
* The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]
* There may have been an error evaluating the function, event, or macro.
This tutorial lists the events that can be canceled programmatically.
Me.SiteName.Value = " "
it gives me a runtime error 2448 - saying that this object cannot be assigned. I m not sure what the problem is. However when I put the same code behind a button, it works perfectly!
When the value of 'station' combo box is 'Nationwide', then I want that all values on the combo box list in 'Language' field is automatically selected.
How should I write the after update procedure? I have been having fun with it for the last two days.