Duane,
I only have Ms Access. What do you mean by create one?
(in Ms Access??) and would you please show me how to select my query as the record source. I am confused. I thought it is VB coding. Please don't laugh. Thanks.
Here is my query coding:
Set db = CurrentDb
db.QueryDefs.Delete ("Genesis") 'Clean out whatever in query Genesis before filling the data.
Set QDF = CurrentDb.CreateQueryDef("Genesis")
strqry = "Select spriden_last_name, spriden_first_name, spriden_id from spriden, rorstat, rcrapp1 where rorstat_pidm = spriden_pidm and spriden_pidm = rcrapp1_pidm and spriden_change_ind is null"
'strqry = strqry & " from spriden, rorstat"
'strqrq = strqry & " where rorstat_pidm = spriden_pidm and spriden_pidm = rcrapp1_pidm and spriden_change_ind is null and"
'strqry = strqry & " spriden_change_ind is null and"
strqry = strqry & " and rorstat_aidy_code = " & "'" & [Forms]![Tracking_Form]![Aidy_Code] & "' and rcrapp1_aidy_code = rorstat_aidy_code"
strqry = strqry & " and rorstat_tgrp_code = " & "'" & [Forms]![Tracking_Form]![Tracking_Code] & "' and rcrapp1_curr_rec_ind = 'Y' and rcrapp1_signed <> '" & signed & "' order by spriden_last_name, spriden_first_name"
'strqry = strqry & " and rcrapp1_signed = ' " & signed & "'" & " order by spriden_last_name, spriden_first_name"
QDF.SQL = strqry
QDF.Connect = cnnstr
QDF.ReturnsRecords = True
DoCmd.OpenQuery "Genesis", acViewNormal, acEdit
End Sub