Expression Builder

burrina

Registered User.
Local time
Today, 11:02
Joined
May 10, 2014
Messages
972
I am having difficulty referring to a couple of subforms.
They are both have Other name and All name

Code winds up looking like this:

PHP:
If [Forms]![frmEmployees]![ ].[Form]![txtVacHrTotal] > 364 And [Forms]![frmEmployees]![ ].[Form]![txtVacHrTotal] < 730 Then
        [Forms]![frmEmployees]![ ].[Form]![lbltxtVacHr].Caption = "1 Week"
End If

Here is a screenshot of the expression builder, notice the Report Icons instead of the subforms, no fields are available ?
 

Attachments

  • ExpressionBuilder.jpg
    ExpressionBuilder.jpg
    39.4 KB · Views: 129
  • Error2447.jpg
    Error2447.jpg
    25.6 KB · Views: 115
Last edited:
It begs the question, why are you using a report inside a form? Where exactly are you calling the expression builder and where are the subforms located?

A subform/subreport should be thought of as a control. It is a control like any other control, i.e. a textbox, label, combo box etc, with each control having its own purpose. A textbox is used to hold text that can be manipulated with the keyboard and can be bound to a field, a label is used to hold text that can't be manipulated with the keyboard, and in the same vein a subform control is used to hold/house a form. A window on the other hand is a superset of a control, i.e. it can hold multiple controls and/or windows and its properties differ. As far as naming convention goes, in my opinion, a short prefix such as "sbf" for subform or "sbr" for subreport would suffice.
 
I am NOT using a Report inside a form. It just looks like that! It is a subform.
I don't have issues with referring to a subform but this is out of my expertise.
I did resolve my code issue but still no explanation about this.

Thanks,
 
So are you saying that there's an issue with the Expression Builder? Does it happen on other forms?
 
I really can't say. It's rare that I use the expression builder anyway.
 
I have not tested it yet. This was a Re-Designed form, so I was surprised.
I will when I get time.
 
See what happens, and let us know. Looks like Uncle G is offline.
 
I went through several databases that I have written with similar form structure with no problems. So I think for some reason Access does not like the naming convention of the subforms.

I have not tried renaming them as I would also have to change a bit of code but will get around to it and see if it resolves the issue.

Access is strange. Things that work in the one db, copy over to a new one and you have to modify it ??? Same format,etc...

Stay Tuned ,,,

P.S. I miss Access 97.
 
I have officially confirmed that it IS an issue. I placed a NEW different form and it showed up in the Expression Builder as a Report where you can't see or access any fields. ???

I don't think my situation is all that unique, maybe it is.

I have a frmEmployees with tabs on it with subforms on the tabs.
On one of the tabs with a subform on it I have 2 other subforms linked via a fakekey
Maybe that's it ? Beyond my pay grade.
 
What about a new database? The linkage between your other subforms shouldn't affect it.
 
Did you copy and paste the forms across or did you create fresh forms?
 
I copied a different form altogether. I did not use the same form.
As my issue is resolved, I'm going to put this to rest. To much work to create all new forms and re-test. As far as I'm concerned, this is on Microsoft.

I could of course be wrong, but will leave it at that.

Thanks for the replies.

Dave,
 
The same problem may arise in the future so it's worth investing more time getting to the bottom of it.
 
Fresh ones, still researching the issue. It is causing me lot of problems.
 
I CAN definitely confirm this to be a bug. I rebuilt the forms/tables/queries in question form scratch and still can't see the subform as a form, instead it sees it as a report and you can refer to it or access any controls via the expression builder.
No copying/pasting,etc...

Case Closed:
 
Yes, we all new this would come back and bite you in the backside.
Best to un-install and re-install Access. But first test your db on a different machine and see if you encounter the same problem.
 
Okay, I moved it to another pc. Still same issue???
 

Users who are viewing this thread

Back
Top Bottom