MS ACCESS VBA If Form textbox value in table and date is not null then

Need to write VBA to determine if a textbox value is in table then . . . update table
deer777Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

deer777Author Commented:
then I need to run stored procedure to insert into table on the SQL Server side
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You'll have to give a little more detail.

Do you want to determine if the value exists in a specific column in the table? Or in several columns in the table?

You can use DCount to determine if it exists in a single column:

If Nz(Dcount("*", "YourTable", "YourColumn=" & Me.YourTextbox), "") <> "" Then
  '/ the value exists
Else
  '/ the value does not exist

You'd have to show us the stored proc in order for us to provide you with specific advice on running that.
End If
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PatHartmanCommented:
VBA doesn't directly access tables.  You would do this by creating an update query that selects the record you want to update if the value is null and sets the value to whatever you want.

I'm guessing that you are making this harder than it needs to be.  Are you not using a bound form?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.