Solved

How to create conditional onclick event in MS Access 2007

Posted on 2010-08-17
2
291 Views
Last Modified: 2012-05-10
Hello experts,
I have a form (Form1) which has 4 combo box and a button, once the user clicks the button what i wanted to happen (in order)....
1.0 checks that all combo boxes has value selected.
2.0 Checks the database if the values (all selected) does not exist in my table (tbl1)
2.1 If values exists then open Form2
2.2 If values does not exist then run append query (insert records to tbl1) then open form3.
Is this possible? If yes, id appreciate some example or links to learn how to do it.
0
Comment
Question by:jsuanque
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 33460587
yes it is possible, but you are asking too much in one thread, break the requirements into sevral questions..

for No 1..

private sub button_click()
dim ctl as control
   for each ctl in me.controls
      if ctl.controltype=accombobox then
          if len(ctl & "")=0 then
             msgbox ctl.name & " have no value selected"
             me(ctl.name).setfocus
             exit sub
          end if
      end if
  next

end sub
0
 

Author Closing Comment

by:jsuanque
ID: 33460644
Thanks. It works...i'm opening a new thread for item 2...
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question