• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

How to create conditional onclick event in MS Access 2007

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
jsuanque
Asked:
jsuanque
1 Solution
 
Rey Obrero (Capricorn1)Commented:
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
 
jsuanqueAuthor Commented:
Thanks. It works...i'm opening a new thread for item 2...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now