G
Guest
I need to write an update query that calls a module, to assign values from a string of characters to another field. I've never used modules before, and using a query with a nested Iif statement doesn't seem to be the way to go. I've successfully coded a ton of forms, though this is proving very difficult for me
The table that stores the original and final data (tblDataBT) contains fields such as: Cost, Unit1, Description, Date. Those fields, among others, are to be updated with segments of data from field "Source" [located within the same table] depending upon the value of the first 6 characters of "Source".
I was hoping to use select case, because it's the most straightforward for me
Select Case left([Source],6
Case 10279
Cost=mid([Source],20,10
Case 10051
OCC_Q=rtrim(mid([Source],27,15
UNIT1=mid([Source],19,11
UNIT2=mid([Source],63,11
UNIT3=mid([Source],96,11
UNIT4=mid([Source],107,11
UNIT5=mid([Source],118,11
UNIT6=mid([Source],129,11
'many more cases will be include
End Selec
Can anyone show me how to start the module? For instance, how do I tell the module the table (or maybe query of the table because of I'm using part of the field) that I'm referring to.
Thanks
The table that stores the original and final data (tblDataBT) contains fields such as: Cost, Unit1, Description, Date. Those fields, among others, are to be updated with segments of data from field "Source" [located within the same table] depending upon the value of the first 6 characters of "Source".
I was hoping to use select case, because it's the most straightforward for me
Select Case left([Source],6
Case 10279
Cost=mid([Source],20,10
Case 10051
OCC_Q=rtrim(mid([Source],27,15
UNIT1=mid([Source],19,11
UNIT2=mid([Source],63,11
UNIT3=mid([Source],96,11
UNIT4=mid([Source],107,11
UNIT5=mid([Source],118,11
UNIT6=mid([Source],129,11
'many more cases will be include
End Selec
Can anyone show me how to start the module? For instance, how do I tell the module the table (or maybe query of the table because of I'm using part of the field) that I'm referring to.
Thanks