UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Cater For Null Values, Access 2016    
 
   
mike60smart
post Aug 16 2019, 12:07 PM
Post#1


UtterAccess VIP
Posts: 13,397
Joined: 6-June 05
From: Dunbar,Scotland


HI everyone

I have the following code that works just fine. However one of the Controls sometimes does not have any data.

The Control is named "CMSV"

How would I modify the code to cater for this?

Any help appreciated.

CODE
strSQL = " UPDATE tblPayrollVar SET OTFine = " & lngOTFine & ", Arrears = " & lngArrears _
& ", OTAppreciation = " & lngOTAppreciation & ",[CMSVRemarks] = '" & Me.CMSV _
& "' WHERE EmployeeID = " & Me!EmployeeID & ";"
Debug.Print strSQL
CurrentDb.Execute strSQL, dbFailOnError

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
 
Start new topic
Replies
ADezii
post Aug 19 2019, 07:27 AM
Post#2



Posts: 2,676
Joined: 4-February 07
From: USA, Florida, Delray Beach


yw.gif , Mike. In case you're interested, I revised the Demo to now reference Fields instead of Literals. Sounds like you have it already figured out, but I'll post it anyway. Good Luck with your Project.
Attached File(s)
Attached File  Cater_For_NULLs_Demo_2.zip ( 26.3K )Number of downloads: 2
 
Go to the top of the page
 

Posts in this topic



Custom Search


RSSSearch   Top   Lo-Fi    15th October 2019 - 11:50 PM