D
DS
I'm trying to use TableDefs in another DB other than my current DB.
I have a function that finds the other DB as thiscan change.
Here is the function.
Public Function REDACT() As String
Dim strPath As String
strPath = Nz(DLookup("BackName", "tblBackPath", "BackID=1 AND
BackActive=-1"), "")
REDACT = strPath
End Function
Here is my code....
I'm getting the red writing starting with the first line SetDB = CurrentDb
IN
Any help is Appreciated.
Thanks
DS
'PRORED*************************
If Len(REDACT()) > 0 Then
Set DB = CurrentDb IN '" & REDACT() & "'
With DB.TableDefs("tblInfoItem")
.Fields("ItemTaxRateID").DefaultValue = _
Me.TxtTaxRateID
.Fields("ItemTaxRate").DefaultValue = _
Me.TxtTaxRate
With DB.TableDefs("tblInfoMod")
.Fields("ModTaxRateID").DefaultValue = _
Me.TxtTaxRateID
.Fields("ModTaxRate").DefaultValue = _
Me.TxtTaxRate
With DB.TableDefs("tblInfoSubMod")
.Fields("SubModTaxRateID").DefaultValue = _
Me.TxtTaxRateID
.Fields("SubModTaxRate").DefaultValue = _
Me.TxtTaxRate
With DB.TableDefs("tblCheckDetailsTMP")
.Fields("CDTaxRate").DefaultValue = _
Me.TxtTaxRate
End With
End With
End With
End With
Else
End If
'*******************************
I have a function that finds the other DB as thiscan change.
Here is the function.
Public Function REDACT() As String
Dim strPath As String
strPath = Nz(DLookup("BackName", "tblBackPath", "BackID=1 AND
BackActive=-1"), "")
REDACT = strPath
End Function
Here is my code....
I'm getting the red writing starting with the first line SetDB = CurrentDb
IN
Any help is Appreciated.
Thanks
DS
'PRORED*************************
If Len(REDACT()) > 0 Then
Set DB = CurrentDb IN '" & REDACT() & "'
With DB.TableDefs("tblInfoItem")
.Fields("ItemTaxRateID").DefaultValue = _
Me.TxtTaxRateID
.Fields("ItemTaxRate").DefaultValue = _
Me.TxtTaxRate
With DB.TableDefs("tblInfoMod")
.Fields("ModTaxRateID").DefaultValue = _
Me.TxtTaxRateID
.Fields("ModTaxRate").DefaultValue = _
Me.TxtTaxRate
With DB.TableDefs("tblInfoSubMod")
.Fields("SubModTaxRateID").DefaultValue = _
Me.TxtTaxRateID
.Fields("SubModTaxRate").DefaultValue = _
Me.TxtTaxRate
With DB.TableDefs("tblCheckDetailsTMP")
.Fields("CDTaxRate").DefaultValue = _
Me.TxtTaxRate
End With
End With
End With
End With
Else
End If
'*******************************