Ashfaque
Search Beautiful Girls from your town for night
- Local time
- Tomorrow, 01:25
- Joined
- Sep 6, 2004
- Messages
- 897
Hi,
I have 2 tbls called T_SOHeader & T_SOFooter1 with one to many relationship which is InvNum.
My main invoice form called "F_SOHeader" with its footer form both are based on the above 2 tbls.
In footer form I am calling product info by inputing productcode in a combo. Till here everything is working smoothly. (Temporary I am displaying custcode on header form)
What I am looking for is:
I want to display last (latest) price in a text box called TxtOldPrice. If the previous record is avalable for this customer for the selected item entered in T_SOFooter1, it would display in this TxtOldPrice......just for reference only.
Therefore I wrote below :
......
.........
Set rst1 = CurrentDb.OpenRecordset("select T_SOHeader.CustCode,T_SOFooter1.productcode, " & _
"T_SOFooter1.Max(InvNum), T_SOFooter1.salesitemprice " & _
"FROM T_SOHeader LEFT JOIN T_SOFooter1 ON T_SOHeader.InvNum = T_SOFooter1.InvNum " & _
"Where T_SOHeader.CustCode='" & Forms!F_SOHeader!CustCode & "'")
If rst1.EOF And rst1.BOF Then
Me.TxtOldPrice = 0
Else
.....
.......
But gives run-time error 3079.
The specified fild InvNum could refer to more than one table listed in the FROM clause in your SQL statement.
Can someone help me please...
Thanks,
I have 2 tbls called T_SOHeader & T_SOFooter1 with one to many relationship which is InvNum.
My main invoice form called "F_SOHeader" with its footer form both are based on the above 2 tbls.
In footer form I am calling product info by inputing productcode in a combo. Till here everything is working smoothly. (Temporary I am displaying custcode on header form)
What I am looking for is:
I want to display last (latest) price in a text box called TxtOldPrice. If the previous record is avalable for this customer for the selected item entered in T_SOFooter1, it would display in this TxtOldPrice......just for reference only.
Therefore I wrote below :
......
.........
Set rst1 = CurrentDb.OpenRecordset("select T_SOHeader.CustCode,T_SOFooter1.productcode, " & _
"T_SOFooter1.Max(InvNum), T_SOFooter1.salesitemprice " & _
"FROM T_SOHeader LEFT JOIN T_SOFooter1 ON T_SOHeader.InvNum = T_SOFooter1.InvNum " & _
"Where T_SOHeader.CustCode='" & Forms!F_SOHeader!CustCode & "'")
If rst1.EOF And rst1.BOF Then
Me.TxtOldPrice = 0
Else
.....
.......
But gives run-time error 3079.
The specified fild InvNum could refer to more than one table listed in the FROM clause in your SQL statement.
Can someone help me please...
Thanks,