?
Solved

check yes/no currenddb.execute

Posted on 2003-11-24
6
Medium Priority
?
278 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
[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
  • 3
  • 2
6 Comments
 
LVL 34

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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 

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 140 total points
ID: 9812304
By the way, you could have made matters easier on yourself by using an option group instead...
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

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

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…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

777 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