Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to create conditional onclick event in MS Access 2007

Posted on 2010-08-17
2
Medium Priority
?
295 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 1000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

609 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