Access 97- if... and if... then Coding

I usea form with check boxes.  I have code that If one box is checked
Then change a list to "1"

Private Sub XXX_AfterUpdate()
If (Me.XXX = -1)  Then
Me.List117 = "1"
End If

I want to write a code that if two (or more) boxes are checked Then
change list to 2

Private Sub XXX_AfterUpdate()
If (Me.XXX = -1) and
If (If Me.YYY = -1 ) Then
Me.List117 = "2"
End If

I would appreciate any help.

0
jeschaefer
7/12/2007 1:43:03 PM
access 16762 articles. 3 followers. Follow

1 Replies
891 Views

Similar Articles

[PageSpeed] 31

Have you checked Access HELP for the syntax on the If...Then function?

Perhaps:
    If (Me!XXX = -1) And (Me!YYY = -1) Then
        'do this
    Else
        'do that
    End If

Regards

Jeff Boyce
Microsoft Office/Access MVP


<jeschaefer@usa.net> wrote in message 
news:1184247783.815828.287050@57g2000hsv.googlegroups.com...
>I usea form with check boxes.  I have code that If one box is checked
> Then change a list to "1"
>
> Private Sub XXX_AfterUpdate()
> If (Me.XXX = -1)  Then
> Me.List117 = "1"
> End If
>
> I want to write a code that if two (or more) boxes are checked Then
> change list to 2
>
> Private Sub XXX_AfterUpdate()
> If (Me.XXX = -1) and
> If (If Me.YYY = -1 ) Then
> Me.List117 = "2"
> End If
>
> I would appreciate any help.
> 


0
Jeff
7/12/2007 4:03:10 PM
Reply:

Similar Artilces:

Updating 20k+ rows from Excel to access. vbscript? VBA? SQL?
Any suggestions? Some of these rows only need a few columns updated, and others need all of them updated. If possible if say row 800 column 'S' is filled in the access DB but is blank on the excel spreadsheet, if possible i like to keep the existing data in access and over right it with a blank cell. The spreadsheet is a export of the access DB, changes were made/merged from other spreadsheets so the Unique ID is the same and in column A. A script suggestions to complete this? Thanks :) dim dbe dim db dim ssql set dbe = createobj("dao.dbengine.36") set db = dbe.openda...

Prevent User to grant mailbox access permission
Hi, there, By default, in Outlook user can grant other user access permission to his/her mailbox folder. But, our company doesn't want this. Is there anyway to prevent user to grant access permission to his/her own mailbox and sub- folders? Any input is much appreciated. David ...

ZIP codes beginning with 0
I'm having trouble getting ZIP codes beginning with 0 to stick, even when specifying ZIP code in the format category type. No matter what I do, the initial 0 always gets dropped. Advice? Thanks. Hi Peter.......... Either pre-format your cells as TEXT, or enter a leading apostrophe before entering the number with the leading 0........the apostrophe won't show, it only forces TEXT formatting on that cell.......... Vaya con Dios,] Chuck, CABGx3 "Peter" <anonymous@discussions.microsoft.com> wrote in message news:2ab7001c46836$3382cf70$a601280a@phx.gbl... > I&...

MS Access to MS excel
When I'm Access�. After a report has been generated (in Word format) I usually merge i with MS Excel and then email it off to our clients. However the forma of some of the fields change when this merge takes place. The date column will be in a date format in Access but when merged wit Excel the date format changes to a text format (what this means is tha the properties of the date column changes when the merge takes place) This change affects how our clients ingest the data I send them Yo can see this by going into one of the date cells in Excel and checkin the properties. I am u...

where databases are to be stored in Access
i don't know where databases are to be stored in access, im excited about the search on access in order to be a professional user like others. cheers Microsoft Access uses a single file, with the ".mdb" extension, to store everything. -- Regards Jeff Boyce www.InformationFutures.net Microsoft Office/Access MVP http://mvp.support.microsoft.com/ Microsoft IT Academy Program Mentor http://microsoftitacademy.com/ "darkus" <darkus@discussions.microsoft.com> wrote in message news:0933B08B-2051-4C0F-B0E7-D644C7E7B606@microsoft.com... > i don't know where ...

RMS and Bar Coding
We are having a year end inventory count performed and need to send a file with all bar codes. Can we delete old bar codes that have not been used for awhile to shrink this file? Or can we send a numerical file with just the bar codes that currently show inventory? If so, how is this done? We own Store Operations 1.20 -- Joanne Mahoney SDN Consulting Jacksonville, FL ...

Tax Codes?
Does anyone know the tax codes Microsoft Money uses for transactions? Thanks, Brook In microsoft.public.money, Brook wrote: >Does anyone know the tax codes Microsoft Money uses for >transactions? Explain what you mean. What I am looking for are the Tax Codes for Different Transactions: I.E. If I wanted to create a 401k tracking within my Microsoft Money, I was trying to figure out how I need to tax code my transaction so everything appears properly. Hope this is clear. Brook >-----Original Message----- >In microsoft.public.money, Brook wrote: > >>Does anyone...

Add a new code macro
I have workbook that I am trying to use with a macro form another post on this form. It inserts a new row with the formulas and contents of the selected row. The problem is that it copies the row below the one selected, and because of this, I can not make a copy of row 2 below the column headers. Any ideas? Thanks. Here is the code: '/=======Start of Code==========================/ Sub InsertRowsAndFillFormulas() 'adds desired # of lines below the current line and ' copies the formulas to that/those lines 'added selection of more than one worksheet ' - Gary L. Brown &#...

How to get looping VBA code to respond to events on worksheet
Hello, I have some code of the form do while not g_Paused bunch of calls ... loop where I'd like the variable g_Paused to be toggled by a button on the worksheet. The only way I can seem to get the code to respond to the button click is to use do while not g_Paused bunch of calls ... ThisWorkbook.Worksheets("Name").Activate DoEvents loop But this is pretty slow and causes the sheet to flicker...is there a better method? PS I'm using buttons from the Control Toolbox Thank you. ...

Using Code instead of Criteria
In my query builder, I'm getting the message: "The string returned by the builder is too long. The result will be truncated." I think I understand why, as I am using a form to specify a large number of options for the report. Can I use VB to specify these criteria instead of the query builder? Examples in query builder: If [Forms]![boxSeatsMailings]![PW] Criteria =1 and (PFDirect>0 or PFBulk>0 or PIDirect>0) then select record. If [Forms]![boxSeatsMailings]![PW] Criteria =2 and (PFDirect>0 or PFBulk>0 or PIDirect>0) then select record. As ind...

Newb question: How did my Form_.... Access Class Objects get crea
I have an access database that originally was created in office 2003 access. I am not in 2007 Access. When I go into the IDE, I can see, under Microsoft Office Access Class Objects, a set of what appears to be modules named: - Form_form abc - Form_form xyz etc Each of these corresponds to an actual form I have created, and includes subroutines like Private Sub RefreshAssetTable() ImportExcel End Sub Private Sub Command4_Click() ImportExcelAssets End Sub by default. Now, my question: How did this class "modules" (and I know that is the wrong term) get created? I &...

What can stop a PC from displaying Access 2000/2003 text & background colours?
Can anyone suggest a reason why a specific Dell Inspiron 9300 laptop should be unable to display any of the text or background colours on an utterly basic test form with only a couple of text boxes and no VBA code on an otherwise empty test database? The problem also happens with an application of mine using Access 2003 runtime - but only on this PC. It runs fine on several other PCs. I have applied every available Windows XP Home update and every available Office 2000 update to no effect. The laptop (set to 32-bit colour) can display digital colour photographs without any problem and ...

COM communicate with managed code(.NET)
Hi! When I have a communication from COM to managed code(.NET) a type library(TLB) is necessary in between to handle the communication from COM to ..NET. I tried to use Red Gats's reflector to look into the type library that have extension tlb but it's not possible. So why is it not possible ? //Tony "Tony Johansson" <johansson.andersson@telia.com> wrote in message news:O%23lutgv5KHA.5464@TK2MSFTNGP05.phx.gbl... > I tried to use Red Gats's reflector to look into the type library that > have extension tlb but it's not possible. ...

character code
I'm trying to figure out the code for a rectangular block. I have some text that comes out of an old DOS program. It's mostly text but there are a few odd characters. I've handled most of them but one is a vertical rectangluar block. This old DOS program exports the block into a text file as a � (Y with an accent mark above it). I have a macro (vba code) that is converting the Y into a pipe symbol but I'd rather convert it into the block that it's supposed to be. If I open the DOS program, copy the text to the clipboard and paste it directly into Word it does show t...

Unableto access "greater than or equal to" Where is it?
Hi. I'm trying to find on Excel, the thing that allows me to write a function, so that all the numbers written in a specific area/column (greater than some number but less than another) come out highlighted. Could you please email back regarding how to access this "greater than or equal to" function? Thank you very much. greater than or equal to.......>= less than or equal to............<= -- paul remove nospam for email addy! "ddewdrops522" wrote: > Hi. I'm trying to find on Excel, the thing that allows me to write a > function, so that...

Please explain the steps to use the Dlookup function in Access?
explain me the steps to use the dlookup function like how we use in EXCEL See: Getting a value from a table: DLookup() at: http://allenbrowne.com/casu-07.html -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Balu" <Balu@discussions.microsoft.com> wrote in message news:00601393-C86C-47BD-9103-52D0FAA292C9@microsoft.com... > explain me the steps to use the dlookup function like how we use in EXCEL ...

Access 2000... how to import a word document?
I am told Access will allow inport of a Word document by converting the document to Rich Text w/delimiter, then into Access. Does that not work with Access 2000? It depends what you mean by "import a Word document". If you have data in a table in a Word document, convert the table to text, paste the text into a new file, and save it as plain (not rich) text; then import the text file into Access. Alternatively, paste the table into Excel, save in Excel or CSV format, and import the resulting file into Access. Which of these works best depends on just what's in the data. ...

Problem with Macro Code
I have the following selected piece of Code that hits debug on line "ActiveSheet.Paste". The reason it does is that a command window comes up saying "Do you want to Replace the Contents of the Destination Cells" - how can I automate this to say "Yes" within my code? Sheets("Claim Form").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True ActiveSheet.Unprotect Password:="123" Range("A1").Select Cells.Select Selection.Copy Sheets("E-Claim").Visible = True Sheets("E-Claim&...

Need access advise regarind linked versus imported tables
I have designed an application that uses a linked csv file as the main table. The reason for this is because another user creates this file and jsut puts it into a designated folder on their computer. Here is the issue. The csv file contains approximately 20K records. I cannot create any type of index on a linked file. Am I better off importing the file into access (or reading the linked table and inserting them into another table with an index)? Is there an easy way to perform something like this? Will this increase performance? I am pretty new to access and am looking for any and all...

How to access a category name and code from vbscript
I am modifying the lineitem.html for the status bar in Store operation. I want to ask how can i access the category name and code for each item, i only can find a categoryid function, which is in the TransactionEntry.Item.CategoryID, but can not access the name and code for the category Raemond, You will need to retrieve the name and code via SQL using the ID: resultSet=QSRules.OpenRecordset("SELECT Name, Code FROM Category WHERE ID=" & TransactionEntry.Item.CategoryID, true) - Evan Culver New West Technologies Raemond wrote: > I am modifying the lineitem.html for t...

access 2000 workgroup security question
I haven't used workgroup security for many years and forgot how it all works but have a situation now where I have an access 2000 database that uses workgroup security and possibly other security and I'm trying to figure out how to get it so I can design forms or export the forms out of the database into an unsecured database. I purchased one of those $30 workgroup password crackers and ran it, here's the results: Lets assume the database is called XXX.MDB and the workgroup is called WWW.MDW For the workgroup we have: "wuser" and "wpassword"...

OWA Access Is Denied for Win2k Users on internet
Dear kind MVPs, Sorry for cross posting and the length.. but i am desperate for the solution. Heres the setup. one Win2k Server (DC) , One Win2k3 Server (DC+Exchange2k3), One server with Reverse-Proxy configured to direct all HTTP requests to the Exchange Server (working OK ). Assume my exchange server name is MyServer and Proxy Server is MyProxyServer and domain is MyDomain - names assumed for clarity otherwise valid IPs are used. I am able to login using http://MyServer/exchange interanlly ( XP + Win2k ) http://MyProxyServer/exchange from XP clients from internet but not from http://My...

MS Access. Can't open file via network
I have the database on one computer and trying to open it via network from another computer so I can simulateously work on it. And yes I do have the option-default mode-shared selected. When I click on the database nothing happens not even an error message. However, when I open the database iniitially from the remote computer it opens fine. Any words of wisdom out there? Thanks ahead of time. Dean :) Dean wrote: > I have the database on one computer and trying to open > it via network from another computer so I can simulateously > work on it. And yes I do have the option-default...

A program is trying to access your Address Book...
We started getting the above message after we isntall Office XP/2002 service pack 3. Does anyone know of a Registry hack that I can setup to either prevent this message always or prevent it for a particular .DLL? For more information on the security features, see http://www.slipstick.com/outlook/esecup.htm -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Author, Google and Other Search Engines (Visual QuickStart Guide) Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Soluti...

Accessing S/MIME properties
I need to access the PR_MESSAGE_CLASS property of a signed, encrypted message in my drafts folder. However, when I read this property using Extended Mapi, it always returns 'IPM.Note', instead of 'IPM.Note.SMIME', which is what it should be. Is there any way I can access this property? ...