I don't see why it is behaving like that. I would be willing to look at a
copy of your database to see if I can figure it out. If you'd like to send
me a cut-down copy of your database, containing only the elements necessary
to demonstrate the problem, compacted and then zipped to less than 1MB in
size (preferably much smaller) -- I'll have a look at it, time permitting.
You can send it to the address derived by removing NO SPAM and ".invalid"
from the reply address of this message. If that address isn't visible to
you, you can get my address from my web site, which is listed in my sig. Do
*not* post my real address in the newsgroup -- I don't want to be buried in
spam and viruses.
--
Dirk Goldgar, MS Access MVP
Access tips:
www.datagnostics.com/tips.html
(please reply to the newsgroup)
Hi Dirk,
The comments were inserted into the post for brevity. In their place I'm
toggling the visibility of various controls based on what I want to see. As
an example, one scenario is:
Forms![frmExpSummary]![Options].Visible = True
Forms![frmExpSummary]![LabelOptions].Visible = True
Forms![frmExpSummary]![LabelPurpose].Visible = False
The entire function as it stands right now is as follows:
Sub GetFormControl(strCtrlName As String)
Dim strSQLRecord As String
If strCtrlName = "CategoryID" Or strCtrlName = "PaidWithID" Or strCtrlName =
"GroupID" Then
' Focus in a control whose list should be expanded, show label and
options
Forms![frmExpSummary]![Options].Visible = True
Forms![frmExpSummary]![LabelOptions].Visible = True
Forms![frmExpSummary]![LabelPurpose].Visible = False
If strCtrlName = "CategoryID" Then
strSQLRecord = "SELECT Category FROM tblExpCategories WHERE
CategoryActive = True ORDER BY Category"
ElseIf strCtrlName = "PaidWithID" Then
strSQLRecord = "SELECT Method FROM tblExpPayMethods WHERE
MethodActive=True ORDER BY Method"
Else
strSQLRecord = "SELECT ExpGroup FROM tblExpGroups WHERE
GroupActive=True ORDER BY ExpGroup"
End If
' Debug.Print "Options recordsource = " &
Forms![frmExpSummary]![Options].RowSource
' Forms![frmExpSummary]![Options].RowSource = strSQLRecord
ElseIf strCtrlName = "Purpose" Then
' No RowSource but show a hint about the field
Forms![frmExpSummary]![Options].Visible = False
Forms![frmExpSummary]![LabelOptions].Visible = True
Forms![frmExpSummary]![LabelPurpose].Visible = True
Else
' Nothing special, hide all hints
Forms![frmExpSummary]![Options].Visible = False
Forms![frmExpSummary]![LabelOptions].Visible = False
Forms![frmExpSummary]![LabelPurpose].Visible = False
End If
End Sub
Thanks for your persistence. I gave up trying to make it work and removed
the Or strCtrlName = "PaidWithID" Or strCtrlName = "GroupID" from the first
If statement. However, if you can give me a clue about what might be
happening, I'd love to re-incorporate those additional checks.