Hi All,
I'm doing a database whereby I'm taking some Manufacturing order details and adding them so we can look quality pass / fail rates and details.
One MO might have anything from 1 to 20 components.
I have linked tour data warehouse to the access file instead of calling it in through SQL (my SQL isnt amazing)
So to explain what I'm trying to do:
Component1 - Counts how many components are on the MO number.
Comp1 - Adds a Zero as the data warehouse stores this as Sequence Number, so component Line 1 is Sequence number 10.
What im trying to do then is loop through the total number of components and add each one to a new line on the components Table - this will hold more data but this area is the sticking point at the moment.
I'm getting a type mismatch on the ![Component] line. Item Number is numberical - 8 digits, although it is saved on the data warehouse as VarChar(15)
Can anyone point me in the right direction?
I'm doing a database whereby I'm taking some Manufacturing order details and adding them so we can look quality pass / fail rates and details.
One MO might have anything from 1 to 20 components.
I have linked tour data warehouse to the access file instead of calling it in through SQL (my SQL isnt amazing)
So to explain what I'm trying to do:
Component1 - Counts how many components are on the MO number.
Comp1 - Adds a Zero as the data warehouse stores this as Sequence Number, so component Line 1 is Sequence number 10.
What im trying to do then is loop through the total number of components and add each one to a new line on the components Table - this will hold more data but this area is the sticking point at the moment.
I'm getting a type mismatch on the ![Component] line. Item Number is numberical - 8 digits, although it is saved on the data warehouse as VarChar(15)
Can anyone point me in the right direction?
Code:
Component1 = DCount("ItemNo", "Server", "MONo=" & MO1)
For x = 1 To Component1
Comp1 = Component1 & "0"
Dim LastID As String
With CurrentDb
Set rsnew = CurrentDb.OpenRecordset("Tbl_component", dbOpenDynaset)
With rsnew
.AddNew
![Component] = DLookup("ItemNo", "Server", "MONo=" & MO1 And "SeqNo=" & Comp1)
.Update
End With
End With
Next x