Filtered Data Form with new additions

G

Guest

I have a form frmBuilding displaying details about a building with a subform
frmCost displaying a SUM of prices associated with that building from a
query. I have a button in frmCost that opens the form frmAddCost that is a
filtered form on BuildingID displaying all related costs associated with the
building. frmAddCost has the ability to add new item but you have to specify
the correct BuildingID otherwise the new addition will be filtered out. How
do i make it so any new items added from the filtered form have a default
value for BuildingID to equal that used in the filter.
 
C

Cinzia

"Edward Jones (Eddie)" <[email protected]> ha
scritto nel messaggio
I have a form frmBuilding displaying details about a building with a subform
frmCost displaying a SUM of prices associated with that building from a
query. I have a button in frmCost that opens the form frmAddCost that is a
filtered form on BuildingID displaying all related costs associated with the
building. frmAddCost has the ability to add new item but you have to specify
the correct BuildingID otherwise the new addition will be filtered out. How
do i make it so any new items added from the filtered form have a default
value for BuildingID to equal that used in the filter.

Hi Eddy,
you can pass the BuildingID to the form frmAddCost in DoCmd.OpenForm
OpenArgs parameter, then in BeforeInsert event you assign the ID
Me.BuildingID= Me.OpenArgs

Bye
Cinzia
 

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