Sorry for the dumb question ... I need to find a record in table tblSegment and get the value of the field seg_num. After the DoCmd, how can I reference the field? Here is my code:
' find out what segment the current contact is in
strSQL = "SELECT tblSegment.seg_projectID, tblSegment.seg_contactID, tblSegment.seg_num " & _
"FROM tblSegment WHERE (((tblSegment.seg_projectID)='" & strProjectID & "') " & _
"AND ((tblSegment.seg_contactID)=" & lngContactID & "));"
DoCmd.RunSQL (strSQL)
' get the segment number somehow and save it in a var for storing a segment record for the new contact
' find out what segment the current contact is in
strSQL = "SELECT tblSegment.seg_projectID, tblSegment.seg_contactID, tblSegment.seg_num " & _
"FROM tblSegment WHERE (((tblSegment.seg_projectID)='" & strProjectID & "') " & _
"AND ((tblSegment.seg_contactID)=" & lngContactID & "));"
DoCmd.RunSQL (strSQL)
' get the segment number somehow and save it in a var for storing a segment record for the new contact