Solved Load records of a bound form after selection of SiteID. (1 Viewer)

moi

Member
Local time
Today, 07:03
Joined
Jan 10, 2024
Messages
230
Hello all,

I have a situation that I was asked if possible to load records on form after selection on combobox of site id?.
 

moi

Member
Local time
Today, 07:03
Joined
Jan 10, 2024
Messages
230
Hello all,

I have a situation that I was asked if possible to load records on form after selection on combobox of site id?.
I have 4 location on tblProperty.. And i have siteid (fk) on tblbuyer.. My form takes records on tblbuyer, meaning it loads all sites (siteid) on opening of my form..
The user (secretary) wanted to load sites per session (edit/verification)..

How should i do that.. Pls i need help..
 

GaP42

Active member
Local time
Today, 09:03
Joined
Apr 27, 2020
Messages
338
Do you mean not to display any records on a form until after the user selects an option on the combobox which filters the records in the forms record source?

Your form on load could have this set
Me.Filter = "(False)"
Me.FilterOn = True
then when you use the cbo ... after update .. you would need
Me.filter = yourcriteriastring
Me.FilterOn = True
 
  • Like
Reactions: moi

moi

Member
Local time
Today, 07:03
Joined
Jan 10, 2024
Messages
230
Do you mean not to display any records on a form until after the user selects an option on the combobox which filters the records in the forms record source?

Your form on load could have this set
Me.Filter = "(False)"
Me.FilterOn = True
then when you use the cbo ... after update .. you would need
Me.filter = yourcriteriastring
Me.FilterOn = True
Yes on opening of the form, it should have no records to display until the user selects which siteid to be loaded/dislay..

So i dont need to change the record source (tblbuyer) of my form?.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 07:03
Joined
May 7, 2009
Messages
19,246
you can also use a query by form query, open form1.
an see the code on the combo's afterupdate event.
 

Attachments

  • LoadSites.accdb
    736 KB · Views: 22
  • Like
Reactions: moi

moi

Member
Local time
Today, 07:03
Joined
Jan 10, 2024
Messages
230
you can also use a query by form query, open form1.
an see the code on the combo's afterupdate event.
Thanks arnelgp... Your demo works easier for me to follow..
 

moi

Member
Local time
Today, 07:03
Joined
Jan 10, 2024
Messages
230
you can also use a query by form query, open form1.
an see the code on the combo's afterupdate
Hi arnelgp,

I think i did something wrong, if i select value to the combo, it stores the siteid value to tblbuyer
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 07:03
Joined
May 7, 2009
Messages
19,246
the combo should be Unbound.
 
  • Like
Reactions: moi

Users who are viewing this thread

Top Bottom