nicholas
December 28th, 1999, 09:53 AM
I have a Jet database with two tables, Tasking and TaskUpdates
In the Tasking table there is an autonumber field "TaskID", no duplicates.
In the TaskUpdates there is a long integer field "TaskID", duplicates allowed.
The "TaskID" in TaskUpdates refer to the "TaskID" in Tasking - there may be many updates to only one task.
When the Task Updates form is launched, I want the grid to show only those updates where Tasking.TaskID = TaskUpdates.TaskID; however sending the TaskID from one form to another has been problematic.
What I coded was:
1. From the main form, when the Task Updates form is launched, I send the TaskID field to a hidden text box on the Task Updates form
frmTaskUpdate!TaskRSValue.Text = datTaskingmdb.Recordset.Fields("TaskID")
2. The from the newly launched Task Updates form, I set the SQL query Tasking.TaskID = TaskUpdates.TaskID
private Sub GridValues()
Dim iRSValue as Integer, sGridSQL as string
iRSValue = TaskRSValue.Text
sGridSQL = "SELECT * FROM [TaskUpdates] WHERE [TaskID] =" & " " & iRSValue
GridTaskUpdates.RecordSource = sGridSQL
GridTaskUpdates.Rebind true
Is there a better way to do this?
In the Tasking table there is an autonumber field "TaskID", no duplicates.
In the TaskUpdates there is a long integer field "TaskID", duplicates allowed.
The "TaskID" in TaskUpdates refer to the "TaskID" in Tasking - there may be many updates to only one task.
When the Task Updates form is launched, I want the grid to show only those updates where Tasking.TaskID = TaskUpdates.TaskID; however sending the TaskID from one form to another has been problematic.
What I coded was:
1. From the main form, when the Task Updates form is launched, I send the TaskID field to a hidden text box on the Task Updates form
frmTaskUpdate!TaskRSValue.Text = datTaskingmdb.Recordset.Fields("TaskID")
2. The from the newly launched Task Updates form, I set the SQL query Tasking.TaskID = TaskUpdates.TaskID
private Sub GridValues()
Dim iRSValue as Integer, sGridSQL as string
iRSValue = TaskRSValue.Text
sGridSQL = "SELECT * FROM [TaskUpdates] WHERE [TaskID] =" & " " & iRSValue
GridTaskUpdates.RecordSource = sGridSQL
GridTaskUpdates.Rebind true
Is there a better way to do this?