Solved

check yes/no currenddb.execute

Posted on 2003-11-24
6
271 Views
Last Modified: 2012-06-27
i have a form with positions help per emp......
i have an active button that specifies the current position...
i'm trying to get an after update expression on the yes/no "active" button so that only one position only can have a yes. so when you select yes... the other yes turns to no....  
i had help on this: but i still can't get it to work... maybe i'm doing something wrong  .... this is a previous help comment i got:  can anyone shine some light on this
cause i'm obviously doin something wrong
thanks a bunch....

CurrentDB.Execute Update tblPositions SET CurrentPosition = False WHERE CurrentPosition = True and Position ID <> " & me.CurrentPosition & " and EmployeeID = " & Me.EmployeeID
0
Comment
Question by:jfgk
  • 3
  • 2
6 Comments
 
LVL 33

Expert Comment

by:Mike Eghtebas
ID: 9809081
try:

CurrentDB.Execute "Update tblPositions SET CurrentPosition = False WHERE CurrentPosition = True and [Position ID] <> " & me!CurrentPosition & " and EmployeeID =" & Me!EmployeeID

Make sure [Position ID] & CurrentPosition fields are both number/long.  If they are string, use:

CurrentDB.Execute "Update tblPositions SET CurrentPosition = False WHERE CurrentPosition = True and [Position ID] <> '" & me!CurrentPosition & "' and EmployeeID =" & Me!EmployeeID

0
 

Author Comment

by:jfgk
ID: 9809390
what is "Current position" supposed to be?
is that the yes no box?
0
 

Author Comment

by:jfgk
ID: 9809452
i'm getting compile error:
expected end of statement
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:jfgk
ID: 9809544
i put the dao3.6 up in the list in there but not i get sub or function not defined at the emp ID
0
 
LVL 5

Expert Comment

by:morpheus30
ID: 9812294
Hi jfgk:

It sounds to me like you want to do is this...

Create an OnClick event on the first check box, let's call it chkBox1:

If Me.chkBox1 THEN
  Me.chkBox2 = FALSE
Else
  Me.chkBox2 = TRUE
End If

Create an OnClick event on the second check box, let's call it chkBox2:

If Me.chkBox2 THEN
  Me.chkBox1 = FALSE
Else
  Me.chkBox1 = TRUE
End If

Then run the query as normal...

CurrentDB.Execute "Update tblPositions SET CurrentPosition = " & Me.CurrentPosition & " WHERE EmployeeID = " & Me.EmployeeID
0
 
LVL 5

Accepted Solution

by:
morpheus30 earned 35 total points
ID: 9812304
By the way, you could have made matters easier on yourself by using an option group instead...
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now