Qualifier: My database is used to document field data collected from salmon spawning ground surveys, and yes, we collect biological samples from stinky dead fish. I am also barely familiar w/ VBA so prefer to use Macros whenever possible.
Anyway, I have a main form (frm_SurveyInfo) which contains a subform (subfrm_CarcassDetail) in datasheet view. In the subform I created a field w/ a hotlink to open a pop-up form to record tags and marks (popfrm_TagsMarks) for individual records (carcasses) in the subfrm_CarcassDetail. So, I need to pass the primary key in subfrm_CarcassDetail (Carcass_ID) to the foreign key in popfrm_TagsMarks (Carcass_FK) for the current record so that I can create a record of tags and marks that relates back to the current active carcass record. Please note, it is important to know that I am trying to open the pop-up from an active record while it maintains focus because the hotlink operation works fine when the current active record loses and subsequently regains focus. Again, my specific problem is getting the pop-up form to open w/ the primary key value being passed to create a new related record; I've tried the Requery operation w/out success. Basically, w/ the Requery command in the macro, it returns the Carcass_ID for the first record in subfrm_CarcassDetail instead of for the active record. I've also experienced the exact same issues w/ getting buttons to work properly.
So, I have an OnClick event that runs the following macro when the hyperlink (AddTagsMarks) from the active record in subfrm_CarcassDetail is selected:
SetTempVar
Name tmpCarcass_ID
Expression = [Carcass_ID]
OpenForm
Form Name popfrm_TagsMarks
View Form
Filter Name
Where Condition =="[Carcass_ID]=" & [Carcass_ID]
Data Mode Edit
Window Mode Dialog
Then, I have an OnLoad event in popfrm_TagsMarks as follows:
SetProperty
Control Name Carcass_FK
Property Value
Value =[TempVars]![tmpCarcass_ID]
Clear as mud? Any thoughts on what is missing to make this work properly? Any and all help is welcome and very much appreciated. thx