icemonster
Registered User.
- Local time
- Today, 15:15
- Joined
- Jan 30, 2010
- Messages
- 502
so basically all this time i have been assigning pk that've been pulled through sql through a text box, i realized you can actually do this via variable. so i have been playing around with it and got it to work, but what i want to do is, how do i reset it once the form closes? here's a sample of my code
Code:
Function startStudentEmailAddress()
strStartSql6 = "SELECT qry_contact_info_student1.id_contact_info_student, qry_contact_info_student1.continfostud_id_student, " _
& "qry_contact_info_student1.continfostud_id_contact_info, " _
& "qry_contact_info_student1.continfo_def, qry_contact_info_student1.continfo_id_type FROM qry_contact_info_student1 "
strWhereSql6 = "WHERE qry_contact_info_student1.continfostud_id_student = " & Forms![frm_main_menu]![lstStudent] & " "
strWhereSql6 = strWhereSql6 & "AND qry_contact_info_student1.continfo_id_type = 3"
strSQL6 = strStartSql6 & strWhereSql6
Set rs = CurrentDb.OpenRecordset(strSQL6)
With rs
If rs.RecordCount > 0 Then
IDContactInfo3 = !continfostud_id_contact_info '<--- this is the FK assigned to variable
Me.txtemailaddress = !continfo_def
Me.txtemailaddressid = IDContactInfo3
Else
Me.txtemailaddress = Null
End If
End With
Set rs = Nothing
End Function