breezett93
New member
- Local time
- Today, 06:23
- Joined
- Jun 7, 2021
- Messages
- 20
I recently had to convert a field in all of my tables because we hit the maximum limit. I rebuilt the relationships exactly to how they were before the change.
So, the user clicks a button that starts the code below. Somewhere, Access is remembering what the old data type was and not allowing the new values to be used. This is the first case that is happening in VBA. For all previous cases, I would just go into Record Source in design view, copy the query text, delete it, and paste it. Then the value not valid errors went away.
Error is triggered on the bolded line below, which makes sense because that is the field that has been updated.
I just don't know the process to fix this as I have verified that OrdId in OrdDetTbl is the same data type as OrderID in IvcDetTbl and the relationship between them has been restored.[/code]
So, the user clicks a button that starts the code below. Somewhere, Access is remembering what the old data type was and not allowing the new values to be used. This is the first case that is happening in VBA. For all previous cases, I would just go into Record Source in design view, copy the query text, delete it, and paste it. Then the value not valid errors went away.
Error is triggered on the bolded line below, which makes sense because that is the field that has been updated.
Code:
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE DISTINCTROW IvcDetTbl INNER JOIN OrdDetTbl ON (IvcDetTbl.OrdItm = OrdDetTbl.OrdItm) AND (IvcDetTbl.OrdId = OrdDetTbl.OrdId) SET OrdDetTbl.Cmplt = Yes WHERE ((IvcDetTbl.IvcId=[Forms]![IvcFrm001]![IvcId]) AND (IvcDetTbl.Cmplt=Yes))"
DoCmd.SetWarnings True
'Update Charges
[B][OrdId] = [OrderID][/B]
[MiscChg] = [MiscCharge]
[CrtDelChg] = [CrtCharge]
[MiscChgDesc] = [MiscChargeDesc]
[MiscChgCode] = [MiscChangeCode]
I just don't know the process to fix this as I have verified that OrdId in OrdDetTbl is the same data type as OrderID in IvcDetTbl and the relationship between them has been restored.[/code]