[AccessD] From no longer loads records
Tina N Fields
tinanfields at torchlake.com
Sat Nov 14 16:34:36 CST 2020
Hi All,
I have a mystery to solve. A database I have for the local Salvation
Army Christmas assistance program is suddenly giving me fits. Each year
some same families return for help. The folks at the SA assign a family
number to each family every year on the paper form they use during the
interview. It will not be the same number assigned to them the previous
year unless that happens by accident. I set up the tblHouseholds to have
a primary key that the user never sees, HH_ID, as well as a field for
the number the workers assign HH_FamCode. At the end of the year, I
remove all the info from the selection fields for the household,
including the family code. All the person records within the family have
PE_ID_HH as a foreign key as well as their own primary key PE_ID, and
these never change. Only things like what pickup day and time are
assigned and what programs they may have selected are emptied from the
records in the tblHouseholds. They wanted to be able to search for a
family that had come to them before, so on the main form frm_Main, I
have a combobox that lists all family names and a button that opens the
frmHouseholdInfo to the record with the matching HH_ID, or at least it
used to. Now, if I select a family name from the combobox and click my
button, it opens the form frmHouseholdInfo as though I were creating a
new record. When I look into the properties, I see that it is filtered
on the correct HH_ID, but it does not display the record.
I've tried working this with VBA in and Event Procedure and working it
with an embedded macro. What used to work is not working and I don't
know why.
So, for the macro attached to the Click event of the btnOpenHH, it goes
like this:
OpenForm
Form Name frmHouseholdInf
View Form
Filter Name
Where Condition =="[HH_ID]="&[cbo_HH_ID]
Data Mode
Window Mode Normal
This used to work.
Switching to making an Event Procedure in VBA, I did this:
Private Sub btnOpenHH_Click()
DoCmd.OpenForm "frmHouseholdInfo", acNormal, , "[HH_ID]=" & [cbo_HH_ID]
End Sub
Neither of these will load the record for the household, although the
form filter property says it's filtered on the correct HH_ID. I get the
form as though I had chosen Add as a data mode, although it has the
filter property set.
Ideas?
Thanks.
T
--
Tina Norris Fields
231-322-2787
tinanfields-at-torchlake-dot-com
More information about the AccessD
mailing list