Assigning a value to an object

atrium

Registered User.
Local time
Today, 16:08
Joined
May 13, 2014
Messages
348
The following code is in the Form Current. As you can see if BranchCode = 2 I want to do a DLookup on the SystemPreferences table that holds a number Branch fields that hold document archive numbers for that branch. I want to move the number in the CroArchiveNo field into the field ArchiveNumber. I then run an Update Query on the system preferences table to add one to the relative branch archive number.

If Me.[BranchCode] = 2 Then
Me.[ArchiveNumber] = DLookup("[CroArchiveNo]", "SystemPreferences", "[SysPrefId] = 1")
DoCmd.SetWarnings False
DoCmd.OpenQuery "UpdateCroArchiveNo"
DoCmd.SetWarnings True
End If


My problem is that I get an error

Run Time error 2448
You can't assign a value to this object


Any help would be appreciated

Atrium
 
I should have referred to the form field name not the control source. Also moved it to the right form

Thanks to anyone who started to burn brain energy on it.

Cheers

Atrium
 

Users who are viewing this thread

Back
Top Bottom