Use tempvars to open a related form

@MajP , You were correct. I added the control to the form, made it invisible. All good. I had the field in the recordset but not the control on the form!. Cheers.
 
Code according to #16: The recordset can contain a lot of records despite filtering. However, a default value can only hold one value. Therefore, carrying through a loop is unfavorable either way.
Additionally: When you filter, it can easily happen that the recordset is empty. That should also be taken into account.
 
Last edited:
This is just my 1 1/2 cents…

I do use TempVars frequently. I have created shortened functions and they work great.

As for the phantom record, I would use the After Insert or After Update as opposed to the the Before events. The Before Events are cancellable and that is a problem.

Glad you solved your conundrum.
 
@spaLOGICng , thanks. What you said makes sense to me. Will review my code. Cheers
 
@Pat Hartman , and other contributers. Thanks & thanks to all. I understand now. Will make the changes you recommend & make sure all my forms reflect this practice in future. That is, 'Before_Update' to validate data and/or back out & 'After_Update' to add FK after the data has been validated by 'Before_Update'. Thanks
 
@Pat Hartman , and other contributers. Thanks & thanks to all. I understand now. Will make the changes you recommend & make sure all my forms reflect this practice in future. That is, 'Before_Update' to validate data and/or back out & 'After_Update' to add FK after the data has been validated by 'Before_Update'. Thanks
Did you not read Pat's reply? :(
 
@Gasman, I did read Pats reply. I'm getting myself in a knot as my project is driving me nuts. My other thread is below. I appreciate all you do & are mindful of not driving you nuts too!

 
All, got it sorted. Using Before_Update to validate data & if me.newrecord to add Fk. Will have a go with Before_Insert as an alternative approach to the if me.newrecord in the Before_Update event. Took me while to get my head round these important events. Thanks for the comprehensive answers.
 
@Pat Hartman , Thanks. Will watch the video & have a look at the database.
 

Users who are viewing this thread

Back
Top Bottom