0
votes

What I am trying to accomplish: Use button to open a form, filter the form, and set specific value to an unbound textbox in the opened form's header. There are multiple buttons being used open the same form and I would like this textbox to changed every time a specific button is clicked.

What I have done so far: Used a macro to open the form and the "where" condition to filter the records. I also used "SetProperty" to change the value of the unbound textbox in the opened form's header depending on which button was clicked. When I do used the SetProperty option in the macro I get the error "The control name ... is misspelled or refers to a control that doesn't exist. Error 32004

I have verified numerous times that this is the correct name for the textbox and everything. I am pretty new to access and don't do VBA all that much so any assistance would be greatly appreciated. Thanks.

First Form and Macro for the "Physical Security" Button

Second form with error and unbound txt box I want to change to "Physical Security"

1
Some code- snippets would be nice- you explain well what you did - but for programmers code is often the best explanation.RuDevel
Well i didn't use any code, just the GUI for macros. How else could i get the code out there to explain or would screen shots help?NavyChief17
Screenshots are not warmly welcome here but in this case they most probably help to understand what you did and what isn't working as expected.RuDevel
Edited to include screen shots.NavyChief17

1 Answers

0
votes

A few Ideas to track down your problem:

  • Maybe there's a problem with opening and (immediately) accessing the forms controls(?) You could try to fire a macro from within the same from that (only) changes the value of this text-box to make sure it definitely works there. Of course you'd want to make it work there if it failed before you'd go back to your original problem.
  • Is the property called value? Could it be text?
  • Are you sure you need to separate (all) hierarchies using !? Just by desperation: Maybe try using Forms!frmVW.txtXY or Forms.frmVW.txtXY

If that doesn't solve it:

It's often best to reduce your problem to it's very basics. Copy your application (!!!!) and radically delete unneeded stuff. Or start a short experiment from scratch (one or two forms, maybe only a button and a textbox, a macro, most probably not even a single Datatable/Source).