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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form has altered object list in VBA 1

Status
Not open for further replies.

carolla

Technical User
May 14, 2004
15
0
0
CA
I’m having a problem working in a database that I did not build, so I am not entirely familiar with it. I have tables tblProperties and tblInspections. tblProperties has information regarding individual properties as well as contact information. tblInspections has information that’s been entered for individual property inspections. It also has fields populated based on the current property information, such as building owner and contact information.
tblProperties is the source for frmProperties and it is from this form that a new inspection is generated. In form design view of frmInspections, the field list has all of the fields as they are in the table, but when I go into VB, the object list for that form is different. For example, in the Form_Load event instead of just PROPCLASS, the list has hidPropClass as well as PROPCLASS. It is referenced in the code that Me.hidPopClass = rst!PROPCLASS, but I’ve added new fields and can’t figure out how to have them referenced this way.
I hope I’ve explained this okay…I’m very lost.
Carolla
 
hidPropClass" could be a control not a field. My guess it is a "hidden or invisible" control on the form. Try this type something like:
msgbox hidPropClass.
When you type in the last "." the intelisense will come on. If there is anything else but "value" in it, then it is not a field.
 
MajP
The intelisense does come on for all of the pre-existing fields/controls that are in the code, but not any of the new fields I've added (the new fields I've added in the table don't even show up in the object list at the top of the code). The intelisense has a complete drop-down list, so I take it it's a control and not a field. How do I add controls for the new fields I've added?
Also, I ran the Documenter for frmInspections and it has all of the fields or controls that begin with "hid" listed as text boxes and not visible. In design view of the form I can't find any indication of these extisting. Have they been renamed somewhere? If they are hidden or invisible controls on the form, how do I find them?
Thanks, Carolla
 
The hidden controls are probably sized down very small. In design view you may be able to "Edit, Select All". You will probably be able to see the black selection highlighting. If you can not find them that way you could write some quick code to open the form in design view, resize the controls, and annotate them somehow (background color etc.)
When you add a field to the forms record source it will appear in the field list. However, often the form is based on a query of a table or group of tables. If you added a field to a table, and the form is based on a query of this table it will not automatically add. My guess is your form is based on a query. Go the the forms property, and click on "recordsource". Ensure the the fields are included in the query.
 
MajP
Thank you, Thank you, Thank you. The controls were all renamed with "hid" and hidden behind one another. I added all the new ones in this format and it's working great.
Carolla
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top