-
Aaron I get and Error Sub or Function not Defined for the Sub. the line RegCreateKey gets highlighted
Sub SaveRegSetting(ByVal lKey As Long, ByVal sSubKey As String, ByVal sValue As String, ByVal vData As Variant)
'Save a String/Long Value to the Registry
Dim lRegKey As Long
Dim lType As Long
Dim lData As Long
Dim sData As String
'Determine the type of Data being Saved
lType = IIf(VarType(vData) = vbString, 1, 4)
If lType = 4 Then
'Long Data Type
lData = vData
Else
'String Data Type
sData = vData
End If
If RegCreateKey(lKey, sSubKey, lRegKey) = 0 Then
'Open/Create the Registry Key
If lType = 1 Then
'Save the String Value to the Registry
Call RegSetValueEx(lRegKey, sValue, 0&, lType, ByVal sData, Len(sData))
Else
'Save the Long Value to the Registry
Call RegSetValueEx(lRegKey, sValue, 0&, lType, lData, 4)
End If
'Close the Registry Key
Call RegCloseKey(lRegKey)
End If
End Sub
-
-
Never mind boy do I feel like a bozzo. I put the declares in a Module and it needs to be in the form code. OOPS!!!
Thanks for your help!