modifying field values in an Access 2003 query

Someone please help.  Is there a SQL or Visual Basic statement that can be 
used to set/change the values in a field in an Access 2003 query to a default 
value?  
0
Utf
11/26/2007 8:34:09 PM
access.queries 6343 articles. 1 followers. Follow

3 Replies
1223 Views

Similar Articles

[PageSpeed] 7

I'm more familiar with the concept of a table's field (or a control on a 
form) having a "default" value.  How is it that you expect a query's field 
to have a default value?  What are the circumstances?

If, for example, you want to display something like "n/a" when an underlying 
field in a table contains a Null, you could use something like:

    YourQueryField: 
IIF(IsNull([YourUnderlyingField]),"n/a",[YourUnderlyingField])

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Jan07" <Jan07@discussions.microsoft.com> wrote in message 
news:3864D750-D34F-4C5B-B014-BFE4C994CAE7@microsoft.com...
> Someone please help.  Is there a SQL or Visual Basic statement that can be
> used to set/change the values in a field in an Access 2003 query to a 
> default
> value? 


0
Jeff
11/26/2007 8:42:44 PM
Thank you…the circumstances are a bit confusing, but I’ll attempt to explain. 
 I need to provide a monthly count of different transaction types which are 
stored in a single table in the database.  The various transaction types are 
identified by a [Tr_type] field containing single letter or letter 
combination values.  The problem is that some records are added to the 
database as one transaction type even though they are really two different 
types of transactions, which need to be grouped and counted separately. These 
particular records can be distinguished by their transaction numbers (a 
trans_num field).  What I am trying to do in the query is change the 
[Tr_type] of those records if the value in the [trans_num] field follows a 
specified sequence, so that they can be grouped and tallied separately in a 
report.  I cannot utilize an update query to change the transaction type in 
the underlying table because I need to create a report that the user can run 
without having to do an update query first. I’m wondering if there is some 
type of “If” statement or function that can be used in the query to 
accomplish this.  I can only use the transaction number to distinguish this 
particular group of records in the database…for all other records I have to 
use the transaction type.  

Thanks for reading...Jan07

"Jeff Boyce" wrote:

> I'm more familiar with the concept of a table's field (or a control on a 
> form) having a "default" value.  How is it that you expect a query's field 
> to have a default value?  What are the circumstances?
> 
> If, for example, you want to display something like "n/a" when an underlying 
> field in a table contains a Null, you could use something like:
> 
>     YourQueryField: 
> IIF(IsNull([YourUnderlyingField]),"n/a",[YourUnderlyingField])
> 
> Regards
> 
> Jeff Boyce
> Microsoft Office/Access MVP
> 
> "Jan07" <Jan07@discussions.microsoft.com> wrote in message 
> news:3864D750-D34F-4C5B-B014-BFE4C994CAE7@microsoft.com...
> > Someone please help.  Is there a SQL or Visual Basic statement that can be
> > used to set/change the values in a field in an Access 2003 query to a 
> > default
> > value? 
> 
> 
> 
0
Utf
11/26/2007 10:21:00 PM
I may not understand enough yet, but I suspect the IIF() statement/function 
should be able to do what you are describing.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Jan07" <Jan07@discussions.microsoft.com> wrote in message 
news:72094ADB-7ED2-4F13-A042-C0B344021334@microsoft.com...
> Thank you.the circumstances are a bit confusing, but I'll attempt to 
> explain.
> I need to provide a monthly count of different transaction types which are
> stored in a single table in the database.  The various transaction types 
> are
> identified by a [Tr_type] field containing single letter or letter
> combination values.  The problem is that some records are added to the
> database as one transaction type even though they are really two different
> types of transactions, which need to be grouped and counted separately. 
> These
> particular records can be distinguished by their transaction numbers (a
> trans_num field).  What I am trying to do in the query is change the
> [Tr_type] of those records if the value in the [trans_num] field follows a
> specified sequence, so that they can be grouped and tallied separately in 
> a
> report.  I cannot utilize an update query to change the transaction type 
> in
> the underlying table because I need to create a report that the user can 
> run
> without having to do an update query first. I'm wondering if there is some
> type of "If" statement or function that can be used in the query to
> accomplish this.  I can only use the transaction number to distinguish 
> this
> particular group of records in the database.for all other records I have 
> to
> use the transaction type.
>
> Thanks for reading...Jan07
>
> "Jeff Boyce" wrote:
>
>> I'm more familiar with the concept of a table's field (or a control on a
>> form) having a "default" value.  How is it that you expect a query's 
>> field
>> to have a default value?  What are the circumstances?
>>
>> If, for example, you want to display something like "n/a" when an 
>> underlying
>> field in a table contains a Null, you could use something like:
>>
>>     YourQueryField:
>> IIF(IsNull([YourUnderlyingField]),"n/a",[YourUnderlyingField])
>>
>> Regards
>>
>> Jeff Boyce
>> Microsoft Office/Access MVP
>>
>> "Jan07" <Jan07@discussions.microsoft.com> wrote in message
>> news:3864D750-D34F-4C5B-B014-BFE4C994CAE7@microsoft.com...
>> > Someone please help.  Is there a SQL or Visual Basic statement that can 
>> > be
>> > used to set/change the values in a field in an Access 2003 query to a
>> > default
>> > value?
>>
>>
>> 


0
Jeff
11/26/2007 11:15:17 PM
Reply:

Similar Artilces:

Outlook 2003 and "Check Names"
Hi, We are testing Outlook 2003 at our office now and there is one very frustrating "feature" that is bugging all of us. When we create a new e-mail message and type in the first name of a person from the global address book and hit ctrl- k to check the name...we get a response that Outlook doesn't recognize the name and there are "no suggestions". The only way Check Name will successfully resolve the name is if we type it last name first (ie, Gates, Bill). This was not the case in Office XP or Outlook 2000. You could search by first name (or partial first name)...

Input Excel 'Password to Open' through control in access form
Hi All, We know,Excel has prompt password to open it files. Is it possible to create a code that can supplies the excel prompt password?.So that when we open the excel file through our access control in a form, the excel files can be opened automatically.But when the excel files opened from its default icon,it will prompt a password first. ...

Compare records in a query then write equation??
Hi all, i have a problem and i need help, the case is as follows: the default rule is that i have 4 fields, (Date, Team, Score). each team is allowed to have one score per day but sometimes it can have 2 scores per day, when this is the case i wanna multiply each score by a certain number and have one score instead of 2 scores (similar to average but not average). So, i need to have a condition which compares records, and if this is the case, formulates this equation and gives me one score instead of 2 scores. Please help SELECT Team, [Date], Sum(Score)/Count(Score) * IIF(Count(Score) =1,1,S...

Password Issue with MS Money 2003
Hello, I am not familiar with newsgroups but I hope it is a forum to seek assistance. I am unable to reach MS support via email from my home computer on this issue. My Money 2003 requires a net passport password to open my account in Money that I have successfully accessed for approximately 12 months. It does not recognize my password now. I have attempted several times with my existing password, changed my net passport password, even uninstalled and re- installed MS Money 2003 to gain access to my account. Nothing has worked. Each time it states I have failed to enter the corr...

Outlook 2003 keeps crashing #2
I get this message when I look in System information. Outlook keeps crashing quite often. I cannot for example delete two messages without outlook crashing. My colleagues do not have this problem. We are using the Microsoft mail exhange server. Faulting application outlook.exe, version 11.0.5510.0, stamp 3f1380f0, faulting module mso.dll, version 11.0.5606.0, stamp 3f334cce, debug? 0, fault address 0x003b6e16. Does anyone has a solution?=20 Best regards/ Bj=F6rn 1) I would definitely apply Service Pack 2for Office 2003 + applicable critical security updates. 2) Have you tried starting O...

Exchange 2003 new install can not receive external email.
I have just setup a new Windows Server 2003 standard edition with Exchange 2003 standard edition on it. I have been working for a while trying to get it to receive external email. I can send out and send/ receive internal messages, but when someone trys to send me a message from outside our network they get the following returned mail message This Message was undeliverable due to the following reason: Each of the following recipients was rejected by a remote mail server. The reasons given by the server are included to help you determine why each recipient was rejected. Recipient: <**...

Excel not Access
I have designed an Access database that holds records relating to my stores audit results going back for about 5 years plus a load more information relating to these stores. This was used to produe a pack once a month, however a change in senior management means that I have got to shelve this and prodce a similar pack in Excel. The idea would be that the user could select a month or a 12 mnth date range that would produce data that could then be used to populate a number of excel templates that have been designed. Having not used excel for years I would be grateful for any suggestion...

Inserting form values into a table
We have a form with values taken from an sql query that comes from two different tables. We would like to enter the information into a third table. Can some one direct me to code that will do the following: 1. Provide the Insert sql that shows us how to add the form values to the table 2. Show us how to loop while inserting the information into the table (there could be several lines on the form, each must be inserted one at a time). I have worked with Access before and have never had a problem inserting information. However, I cannot quite figure out how to insert informtion through an ...

Radar chart in Access 2007 report
Can you add a Radar chart to an access 2207 report? ...

[Exchange 2003] Mail enabled public folder and sender address
I have a Windows 2003 domain with a native mode Exchange 2003 organization; there are some mail enabled public folders. When a user replies to a message in a public folder, the outgoing mail's sender address is the user's one; I want it to be the public folder's one, or at least I'd like the "reply-to" address to be set to the public folder's. How can I accomplish this? Thanks Massimo You would need to grant the user permissions to be able to Send As the public folder. By default, when you reply to a message that is in a PF, the PF is not composing the ...

Outlook 2003
Hello, we have one client pc with Outlook 2003 where the following problem occurs: if a mail is replied from a user created sub folder of the inbox, the reply will not appear in sent mails, but will end up in the same sub folder, sender and recipient appear as identical. The mail goes out properly though, it's just that Outlook sets internally sender = recipient and bounces the reply back to the subfolder in which the original mail is stored. This happens on a Win 2000 machine with SP4 and all updates, the other clients use Outlook 2000 or XP and there is no such problem. There are no ru...

Strange Access Denied Problem with Windows 7
I got a new computer about six months ago that came with Windows Vista Home Premium 64bit. Before that I had done all of my .NET development either on an XP Pro VM or my former XP Pro computer at home. Shortly after getting my new computer at home, I also got a license for VMWare to be able to test my software on multiple platforms and configurations. I had wrote an application originally in VB.NET that was a simple backup utility. It supports mutiple backup configurations. Any given copnfiguration would define a backup which would be a list of files to backup, a list of folders to ...

Install Exchange 2003 Server on new Hardware with same name
I got a new server to move my Exchange Server Installation. I want to keep the name I'm using now for my Server. Already read TechNet Article "How to Move Exchange Server 2003 to New Hardware and Keep the Same Server Name". Is there anything else that I should be aware of that is not on this TechNet article? I'm using a different Disk Configuration, does this matters? Should this be a smooth process? Thanks for any help you can give. The drive letters MUST match, because the paths of the databases are at the Active Directory. The disks can have different sizes than the or...

adding name /creating field/query?
Hello, I can create an invoice_number field in a query using the primary field ID from the main table as invoice_number: ID but if ID say is 100, I cannot work out how to create renewal_invoice_100 Cheers Geoff Geoff We aren't there. We can't see what you're looking at. Where did "renewal_invoice_100" come from and what does it mean? Please post the SQL statement of the query you are trying to use. -- Regards Jeff Boyce www.InformationFutures.net Microsoft Office/Access MVP http://mvp.support.microsoft.com/ Microsoft IT Academy Program Mentor http://micro...

Addressing within Exchange 2003
We are running Exchange 2003 SP2. We setup an MX record for a external email(alumni.cup.edu) these mailboxes do not exist within our exchange org. But when we send email to these externals email mailboxes we are getting the following NDRs: #5.5.0 smtp;550 Mailbox unavailable. #5.4.0 Is there a way in exchange to ignore these email address so that we don't get the NDR from within our Exchange Org? On Fri, 4 Aug 2006 08:08:02 -0700, Sabo, Eric <sabo_e@cup.edu> wrote: >We are running Exchange 2003 SP2. We setup an MX record for a external >email(alumni.cup.edu...

how do i add "Software Digrams" Folder in my Visio 2003
how do i add software diags folder in visio 2003 version. Like if i go to File->New it shows folders like brainstorming, project schedule, block diagrams but in my case its missing the Software Diags folder which contains activity diags, web mock ups, use case diags etc. please let me know how to get that template. thanks. Ankur What edition of Visio are you using? Check by going to the About Microsoft Office Visio dialog from the Help menu. "Ankur" <Ankur@discussions.microsoft.com> wrote in message news:F0D10BF0-A059-4A9C-B615-B99F3916F4E5@microsoft.com... > how...

Filter recordset using query results
Hi all I have a form based on a query called [qry Quarterly Planning], it lists all Itineraries on the system. On this form you can filter records by specifying a Start and End Date for the [ReviewDate] and/or [Specialist]. It is a subform on a main unbound form, lets call this Subform1. Along side this I have another subform (Subform2) which displays ReviewDates that exist against an Itinerary. In other words Subform1 has a start date of an activity and if the activity lasts longer than 1 day, then the additional dates are stored in Subform2 (ItineraryDates). Currently when I...

Office 2003, Outlook (Outlook Today)...
OK, this is driving me nuts. I note that w' 2003 (and XP (2002)?) the default install sets the startup folder to the Inbox. IIRC, one of the earlier Offices installed Outlook to startup w' that "all in one view" - Outlook Today. So just as a wee test - I thought I'd try that for a while, and indeed I found it quite handy to be able to see all pertinent data on the one screen. *However* (and I'm wondering if this is the case with others), I *HAVE* to use my mouse, whenever I switch to the Inbox, or Calendar, or Tasks to get the damn focus onto a 'sujbect&...

HELP! remote data not accessible msg
Hello, I have a use who is currently using a Bloomberg DDE add- in. Whenever he attempts to activate the add-in to retreive remote data, the system hangs. If I go to task manager, I then see a message stating "Remote data not accessible. To access this data Excel needs to open another program.... I have searched the knowledge base and didn't find much help. Does anyone have any ideas? I am desperate!!!! We are currently using Excel 2003 in XP Professional. TIA, Ramissah ...

McAfee 8.5.0i on access scan slows down MS Dynamics CRM web client
Our organization's McAfee 8.50i slows down MS Dynamics CRM v4 - on premise web client considerabley when loading forms and data. Besides completely disabling McAfee, does anyone know how to configure McAfee (or configure CRM) to ignore CRM related form and data loads. When disabling the oncaccess scan, or when disabling the scriptcan - it improves lookups from 8-9 seconds to 4-5 seconds. However, the organizatin policy is to have these enabled. What to do? We have the same behavior, and went we reported to Microsoft says that no solution has, then we buy and install Microsoft Securi...

Need Query Help
I have two tables, Table A & Table B, in my database that have the same fields (Name, SSN, etc). Most of the records in both tables are identical, but each table has some unique records. I would like to run a query that will select the unique records in Table A by comparing SSNs, and then do the same for Table B. I am a database novice, and have tried all the wizards and expression builders with no luck. Any help at all would be appreciated. Thank you!!! Scott Casa Grande, AZ Hi Scott, The "Find Unmatched Query Wizard" is what you need. If you only want to check for SSNs ...

[b]Can I download Excel data to a MS Access database?[/b]
I've built an Excel 2002 form that I want our internal customers to access from our intranet, and use. Once completed, they will send it to us as an e-mail attachment. I'd like to be able to open it, and somehow download the data from the form into an MS Access 2002 database I've built (so that we don't have to rekey it into the database). Is this possible or even feasible? Any and all help is appreciated. Thanks. :D --------- Message sent via www.excelforums.com Hi in Access check 'File - Import External data' -- Regards Frank Kabel Frankfurt, Germany "...

Import from Eudora 6 to Outlook 2003
I am trying to import messages from Eudora 6 to Outlook 2003. I am receiving the error message "The mail folder could not be opened. If another application is using this file, please close and try again. No other applications are running Thanks for any help see article 257354 of the microsoft knowledge base on http://support.microsoft.com: "Outlook Cannot Import Eudora Messages When Eudora Mail Is Stored in a Non-Default Location" ciaos >-----Original Message----- >I am trying to import messages from Eudora 6 to Outlook 2003. I am receiving the error message ...

Excel DNS query
Hello, Is there a way for an Excel function to query a DNS server? Thanks. Soundy Not that I know of, but you can turn on the macro recorder, use 'get external data' and tailor the resulting code into a user function of your own. E.g. I've used this to create a button to get MS-Access data from a query that has the same name as the sheet (tab) name. It saves me a lot of copy-paste actions. Bas Hartkamp <soundy@gmail.com> schreef in bericht news:1151940450.029823.127570@j8g2000cwa.googlegroups.com... > Hello, > > Is there a way for an Excel function ...

outputting values to a range from one formula
I wish to generate a table automatically by means of a single formula that applies an iteration on a starting given value with a given step, and the computed values are posted/entered automtically into cells from a given cell onwards, say below it, until the computed value reaches a certain given limt. This is somehow the inverse of INDIRECT or of OFFSET. These can pull values from a variable addresses of cells. What I need is to push values into a variable addresses of cells. Can anyone help me on that?? Thanks. :confused -- Shafe ---------------------------------------------------------...