Avatar of KLM56
KLM56
 asked on

Help with delete query

It's me again. I have manage to delete records from an access table using an excel userform using the code below. But the only way I am able do so if all fields have a value it it.  So I have a date field and about 6 other numeric fields. When I search for a record, it may not have a value in one of the fields. If it doesn't before I can delete it, I would need to replace the blank fields with a 0, update it, then I can delete the record. How can I delete the record regardless of blank fields or not.


   
strDelete = "Delete from tblMsrTotals Where businessDate = #" & txtbusinessDate.Text & "# and advances = " & txtadvances.Text & " and advanceAmount = " & txtadvanceAmount.Text & " and denied = " & txtdenied.Text & " and stopPayments = " & txtstopPayments.Text & " and branchLoc = " & txtbranchLoc.Text & " and cpg = " & txtCpg.Text & ""

Open in new window

Microsoft ExcelMicrosoft AccessVisual Basic Classic

Avatar of undefined
Last Comment
KLM56

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Lee Wadwell

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
KLM56

ASKER
Thank you. I decided to take your advice and define default value of 0 to the table. That works for me. The other suggestions seem a bit indimidating.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes