I have a form that takes a pk from another open form, what i would like is to show the transactional records for the pk.
i have:
Dim GroupID As String
'get groupid from open group deal form
GroupID = Forms![group main screen form]!GroupID
'create sqlstring
sql = "SELECT FTRAN.FtranID, FTRAN.[AGENT-DSN], FTRAN.[GROUP-DSN], FTRAN.Date, FTRAN.Amount, FTRAN.Description, FTRAN.[F Type], FTRAN.Cat, FTRAN.Method FROM FTRAN WHERE (((FTRAN.[GROUP-DSN])=" & GroupID & ")) ORDER BY FTRAN.Date DESC;"
'now change recordsource for form
Forms![frmgroupftraninput].RecordSource = sql
Forms![frmgroupftraninput].Requery
the code runs all fine and a print debug gives the correct sql string that works if i create a new query based on it.
the recordsource doest appear to update in properties and even if i paste in the sql string it doesnt work either.
the form itself should be based on a table but i am confused between rowsource and recordsource.
i searched but only found references to what i had already done.
regards in advance for help.
peter
i have:
Dim GroupID As String
'get groupid from open group deal form
GroupID = Forms![group main screen form]!GroupID
'create sqlstring
sql = "SELECT FTRAN.FtranID, FTRAN.[AGENT-DSN], FTRAN.[GROUP-DSN], FTRAN.Date, FTRAN.Amount, FTRAN.Description, FTRAN.[F Type], FTRAN.Cat, FTRAN.Method FROM FTRAN WHERE (((FTRAN.[GROUP-DSN])=" & GroupID & ")) ORDER BY FTRAN.Date DESC;"
'now change recordsource for form
Forms![frmgroupftraninput].RecordSource = sql
Forms![frmgroupftraninput].Requery
the code runs all fine and a print debug gives the correct sql string that works if i create a new query based on it.
the recordsource doest appear to update in properties and even if i paste in the sql string it doesnt work either.
the form itself should be based on a table but i am confused between rowsource and recordsource.
i searched but only found references to what i had already done.
regards in advance for help.
peter