I am trying to do a simple Do-while loop to display master and relevant transactions in form/subform environment under Access 2003.
Below are some of my statements:
Dim dbs As DAO.Database
Dim TRANS1, TRANS2 As DAO.Recordset
Set TRANS1 = CurrentDb.OpenRecordset("Master", dbOpenDynaset)
Set TRANS2 = CurrentDb.OpenRecordset("Transaction", dbOpenDynaset)
...
TRANS1.MoveFirst
Do While Not TRANS1.EOF
Me.TEXT456 = TRANS1![TRANSCODE]
Me.Requery
MsgBox "Press anykey to next record!!"
TRANS1.MoveNext
Loop
then I ha e a main and subform creation with at least the variable "text456" to ensure the master transaction code (i.e. the transcode) has been located and are in the main form. In the subform that I have created, I have a condition as [forms]![mainform].[text456] under the "transcode" field in relevant query file. I have also checked that in the property of subform, both the child and parent linkages are stored the "transcode" variable.
But when I run the program, it only show the "transcode" in main form but no data showing in the subform. Any idea, is that the loop with property such as trans1 and trans2 would'nt work in this way!!?? Thanks!!
Below are some of my statements:
Dim dbs As DAO.Database
Dim TRANS1, TRANS2 As DAO.Recordset
Set TRANS1 = CurrentDb.OpenRecordset("Master", dbOpenDynaset)
Set TRANS2 = CurrentDb.OpenRecordset("Transaction", dbOpenDynaset)
...
TRANS1.MoveFirst
Do While Not TRANS1.EOF
Me.TEXT456 = TRANS1![TRANSCODE]
Me.Requery
MsgBox "Press anykey to next record!!"
TRANS1.MoveNext
Loop
then I ha e a main and subform creation with at least the variable "text456" to ensure the master transaction code (i.e. the transcode) has been located and are in the main form. In the subform that I have created, I have a condition as [forms]![mainform].[text456] under the "transcode" field in relevant query file. I have also checked that in the property of subform, both the child and parent linkages are stored the "transcode" variable.
But when I run the program, it only show the "transcode" in main form but no data showing in the subform. Any idea, is that the loop with property such as trans1 and trans2 would'nt work in this way!!?? Thanks!!