fbt
06-30-2001, 10:32 AM
please take the time to read this, if i spend another couple hours trying to fix problem, i may be forced to drive my car into a brick wall.
i have a subform that has a query as a control source. i need this form to filter on the current event of another subform. seems pretty striaght forward. it actually worked twice but it only works sparatically.
heres the code for the current event of the other subform:
Private Sub Form_Current()
If [Form_eachjob].NewRecord Then
[Form_eachcomputer].AllowAdditions = False
Else
[Form_eachcomputer].AllowAdditions = True
'Stop
'___here is the code in question__________
[Form_eachcomputer].Filter = "[eachcomputer Query].jobNum=" & [Form_eachjob].[ID]
msgbox [Form_eachcomputer].Filter
[Form_eachcomputer].FilterOn = True
'________________________________________
End If
End Sub
you may be saying "geewiz that line:
"[eachcomputer Query].jobNum=" & [Form_eachjob].[ID]
should be:
"[Form_eachcomputer].jobNum=" & [Form_eachjob].[ID]"
but actually on the form_eachcomputer i right clicked the field "jobnum" and selected "filter by selection" and grabbed the filter generated by access from the properties of that form. point being, i know that filter works.
there are no error messages. if i actually look at the properties of the form when the filter is supposedly on, it shows no filter. then if i manually enter the filter it does work. you would think that for some reason the filter string isnt making it to the form but the msgbox does show the correct filter. i know the event is firing b/c of the msgbox too. wtf? ive tried saving and reopening the db and ive tried compact and repair...rebooting. im almost sure its a bug in access at this point...btw im using access xp.
[This message has been edited by fbt (edited 06-30-2001).]
i have a subform that has a query as a control source. i need this form to filter on the current event of another subform. seems pretty striaght forward. it actually worked twice but it only works sparatically.
heres the code for the current event of the other subform:
Private Sub Form_Current()
If [Form_eachjob].NewRecord Then
[Form_eachcomputer].AllowAdditions = False
Else
[Form_eachcomputer].AllowAdditions = True
'Stop
'___here is the code in question__________
[Form_eachcomputer].Filter = "[eachcomputer Query].jobNum=" & [Form_eachjob].[ID]
msgbox [Form_eachcomputer].Filter
[Form_eachcomputer].FilterOn = True
'________________________________________
End If
End Sub
you may be saying "geewiz that line:
"[eachcomputer Query].jobNum=" & [Form_eachjob].[ID]
should be:
"[Form_eachcomputer].jobNum=" & [Form_eachjob].[ID]"
but actually on the form_eachcomputer i right clicked the field "jobnum" and selected "filter by selection" and grabbed the filter generated by access from the properties of that form. point being, i know that filter works.
there are no error messages. if i actually look at the properties of the form when the filter is supposedly on, it shows no filter. then if i manually enter the filter it does work. you would think that for some reason the filter string isnt making it to the form but the msgbox does show the correct filter. i know the event is firing b/c of the msgbox too. wtf? ive tried saving and reopening the db and ive tried compact and repair...rebooting. im almost sure its a bug in access at this point...btw im using access xp.
[This message has been edited by fbt (edited 06-30-2001).]