Filter 'automatically' filled in?

P

Pat Dools

Hello,

I have a database in which the Forms in a series execute the code (below)
via the 'On Current' Event Procedure to set the values of four (4) Header
fields based on the values in those same fields in the 'initial' form
('fScrEligCriteria') in the series:

Private Sub Form_Current()
Call SetAutoValues(Me)
End Sub

Sub SetAutoValues(frm As Form)
On Error GoTo SetAutoValues_err

' Set Automatic Values in each form in series
' Add as many fields as necessary (make sure each field has the same
name on EVERY form)
With frm
!studyday = Forms!fScrEligCriteria!studyday
!patient = Forms!fScrEligCriteria!patient
!ptin = Forms!fScrEligCriteria!ptin
!site = Forms!fScrEligCriteria!site
End With

SetAutoValues_err:
'MsgBox Err.Description
Resume Next

I noticed that Access automatically populated the 'Filter' property of the
'Data' tab with the following:

[patient] = Forms.fScrEligCriteria.patient

Recently, the owner of the database asked that field 'patient' be switched
to 'ID' (aren't they wonderful??). I made the switch in the 'SetAutoValues'
module above, without knowing that Access had also populated the 'Filter'
property as shown. My ability to progress thru the forms in the series and
autopopulate those four Header fields seems to be working fine, even though
the field name 'patient' no longer exists anywhere in the database. Is it
necessary to have this 'Filter' property even populated? It seems to be
relying on the Module code rather than this. Is this an additional safeguard
to ensure the correct patient record associated w/ the next form in the
series is chosen (and thus a good idea to update w/ the new field name)??

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top