473,491 Members | 2,552 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CFIF query using input of check box

139 New Member
Hi there,

Having problems with a cfif query based on the value of a check box.

I have an input type="file" field on a form. This allows the user to choose a file and upload the location to the database. Alas, I`m networked, and everyones drives are on different letters, so I need to strip out the first three characters and add them to the server & share.

I can do this, but not in conjunction with a check box - basically saying that if this box if unchecked I don't want to complete the file location field.

CF throws an error saying it can't strip characters from a null value. Can anyone take a look and tell me where I am going wrong?

Checkbox is called 'form.CompletedYN'
Server Location drop down is called 'form.FileServerFK'
File browser box is called 'form.FileLoc'


Expand|Select|Wrap|Line Numbers
  1. <cfparam name="form.CompletedYN" default="0">
  2.  
  3. insert into tblTaskBooker
  4. (FileLoc)
  5. values
  6. (<cfif #form.CompletedYN# EQ 0>
  7. No File Location Assigned
  8. <cfelse>
  9. <cfset FileLocation = '#form.FileServerFK#' & #RemoveChars('#form.FileLoc#',1,3)#>
  10. '#FileLocation#'
  11. </cfif>
  12.  
Thanks
Neil
Sep 22 '10 #1
2 2889
acoder
16,027 Recognized Expert Moderator MVP
You need to put the text in quotes like you've done for FileLocation:
Expand|Select|Wrap|Line Numbers
  1.  <cfif #form.CompletedYN# EQ 0>
  2. 'No File Location Assigned'
Sep 23 '10 #2
ndeeley
139 New Member
That's great, thanks acoder
Oct 6 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
682
by: bdt513 | last post by:
I am trying to extract the values from a query using VBA. Specifically, I want to concatenate all the values of the "rosEmail" field from query "qselRosterEmailList" into one string (strEmails). I...
14
8062
by: Darin | last post by:
I have a table that I want to delete specific records from based on data in other tables. I'm more familiar with Access '97, but am now using 2003, but the database is in 2000 format. In '97, I...
13
2824
by: forbes | last post by:
Hi, I have a user that used the Query Wizard to create a query in Access. Now she claims that her master table is missing all the data that was excluded from the query. Can you create anything...
6
3026
markmcgookin
by: markmcgookin | last post by:
Hi Folks, I am running a simple query using VB (This isnt a VB Question, dont worry!) on SQL Server Compact. I have the query below being created, and then added to if a flower location doesn't...
0
1601
by: =?Utf-8?B?cGF0cmlja2RyZA==?= | last post by:
Hi everyone! I have these three questions and though to post them in a single thread: 1) I have created a textarea: <textarea id="txtCards" cols="50" rows="15" runat="server" wrap="virtual"...
0
2063
by: =?Utf-8?B?VG9ueSBBLg==?= | last post by:
I'm trying to develop a parameter query using Query Builder, the database is Access 2003. I placed a ? in the column to we quered and linked it to a checkbox on the form. When the user selects an...
1
1961
by: EwanD | last post by:
I am trying to read through and process an Access Query using VBA. I have used the OpenRecordset method with parameters as below OpenRecordset(sSourceRecordset, dbOpenDynaset) Where...
6
3047
by: TSIGOS1 | last post by:
Hello, I have created a query in Access and I want to be able to read the sql statement of the query using vba and then run it from excel vba. That is instead of copying and pasting all the query...
3
2316
by: bdavid50 | last post by:
I have an ODBC to several tables in an Oracle 10g installation. I created an Access 2003 query using several of the tables from that ODBC. When I created it, it worked as expected and returned the...
2
2268
by: tomric | last post by:
I have a question on passing data to the criteria of a parameter of a parameter query using VBA. I have a query set up that has ten different fields in it. One is field named “status”, this field...
0
7115
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6978
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
280
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.