D
Dave
On a form i have an unbound list box
I have a sub that i use to refresh the data in the list box if a record is
changed or an item is deleted
Private Sub s_RefreshList()
varstr = "SELECT tlkp_JobDetails.JobDetailKeyID,
tlkp_JobDetails.Description, Sum([Price]*[Quantity]) AS [Parts Cost] "
varstr = varstr & "FROM (tlkp_JobParts INNER JOIN tlkp_Parts ON
tlkp_JobParts.PartKeyID = tlkp_Parts.PartKeyID) "
varstr = varstr & "INNER JOIN tlkp_JobDetails ON
tlkp_JobParts.JobDetailsKeyID = tlkp_JobDetails.JobDetailKeyID "
varstr = varstr & "WHERE tlkp_JobDetails.JobKeyID= " & Me.txtJobKeyID & " "
varstr = varstr & "GROUP BY tlkp_JobDetails.JobDetailKeyID,
tlkp_JobDetails.Description;"
Me.lstWorkDone.RowSource = varstr
End Sub
My question is
How do i run this sub from another form
The reason why is the original form open up another form, this forms adds a
record to the tlkp_JobDetails Table and i want the new record to be in the
list box when i close the second form down
if i use
Forms!frm_Jobs!s_RefreshList
on the close event i get an error saying
Expected: =
I have also tried using Call and that error is
Expected: (
any help or another way to do this would be much appreciated
I have a sub that i use to refresh the data in the list box if a record is
changed or an item is deleted
Private Sub s_RefreshList()
varstr = "SELECT tlkp_JobDetails.JobDetailKeyID,
tlkp_JobDetails.Description, Sum([Price]*[Quantity]) AS [Parts Cost] "
varstr = varstr & "FROM (tlkp_JobParts INNER JOIN tlkp_Parts ON
tlkp_JobParts.PartKeyID = tlkp_Parts.PartKeyID) "
varstr = varstr & "INNER JOIN tlkp_JobDetails ON
tlkp_JobParts.JobDetailsKeyID = tlkp_JobDetails.JobDetailKeyID "
varstr = varstr & "WHERE tlkp_JobDetails.JobKeyID= " & Me.txtJobKeyID & " "
varstr = varstr & "GROUP BY tlkp_JobDetails.JobDetailKeyID,
tlkp_JobDetails.Description;"
Me.lstWorkDone.RowSource = varstr
End Sub
My question is
How do i run this sub from another form
The reason why is the original form open up another form, this forms adds a
record to the tlkp_JobDetails Table and i want the new record to be in the
list box when i close the second form down
if i use
Forms!frm_Jobs!s_RefreshList
on the close event i get an error saying
Expected: =
I have also tried using Call and that error is
Expected: (
any help or another way to do this would be much appreciated