opopanax666
Registered User.
- Local time
- Yesterday, 22:45
- Joined
- Nov 2, 2006
- Messages
- 42
[SOLVED] help with recordset "Fields"
Hi everyone,
not familiar with the "Fields" attribute (I think that's the problem), so asking the experts
Excerpt:
The SELECT query works and outputs 2 columns ([basis_item_naam] & [WOE], when i choose SELECT CASE 3). So far, so good.
The INSERT INTO works too ("bestelling_id", "bestelling_detail_type" & "bestelling_detail_tekst" are filled in).
Problem is: the "bestelling_detail_aantal" field is empty. This is an integer field, and so is "[WOE]", so I think something is wrong with my "rst.Fields(strDAG)" thingy...
Can anybody see what could be wrong?
TIA,
James
Hi everyone,
not familiar with the "Fields" attribute (I think that's the problem), so asking the experts
Excerpt:
Code:
Select Case intDAG
Case 1
strDAG = "MAA"
Case 2
strDAG = "DIN"
Case 3
strDAG = "WOE"
Case 4
strDAG = "DON"
Case 5
strDAG = "VRY"
Case 6
strDAG = "ZAT"
Case 7
strDAG = "ZON"
End Select
For intWINKEL = 23 To 28
strSQL = "SELECT [Basis_item_naam], [" & strDAG & "] FROM qryBasis_items_verdeel_new WHERE (([Bestemming_sub_ID] = " & intWINKEL & ") AND ([" & strDAG & "] IS NOT NULL))"
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(strSQL, dbOpenDynaset)
If rst.EOF Then
GoTo CleanUp2
End If
lngBESTELLING = Nz(Me.Bestelling_ID, 0)
intTYPE = 1
rst.MoveFirst
With rst
Do Until .EOF
CurrentDb.Execute "INSERT INTO dbo_tblBESTELLING_DETAIL (bestelling_id, bestelling_detail_type, bestelling_detail_tekst, bestelling_detail_aantal) VALUES (" & lngBESTELLING & ", " & intTYPE & ", '" & rst![basis_item_naam] & "', " & rst.Fields(strDAG) & ")"
.MoveNext
Loop
End With
next intWINKEL
The SELECT query works and outputs 2 columns ([basis_item_naam] & [WOE], when i choose SELECT CASE 3). So far, so good.
The INSERT INTO works too ("bestelling_id", "bestelling_detail_type" & "bestelling_detail_tekst" are filled in).
Problem is: the "bestelling_detail_aantal" field is empty. This is an integer field, and so is "[WOE]", so I think something is wrong with my "rst.Fields(strDAG)" thingy...
Can anybody see what could be wrong?
TIA,
James
Last edited: