Need Help With String Formatting

Dec 15, 2005

Hey everyone, I need some help with formatting a string for use with the DoCmd.RunSQL() method. I can't figure out how the hell VB deals with escape characters for the purpse of variables inside strings. I have this line right now.

strSQL = "INSERT INTO OS (OS) VALUES(" + OS.Value + ")"


This is supposed to insert one row into the "OS" Table, in the "OS" field. In my form there is a textbox called "OS" and I'm trying to insert that value into the DB table.

Two things.
1) Yes, I know, I have a lot of things named "OS"
2) Yes, I know I don't need to use a string here, but I'm just presenting this is an abbreviated example, in my full program I do in fact need a string.

View Replies


ADVERTISEMENT

Formatting A Date In A String Also Including Text

Feb 2, 2006

Hi there,

I have to format a date following dd-mmm-yy in an expression also containing text.

Expr1: "Text" & " " Date()

Although separately formatting the date is easily done. I need to keep both int he same expression.

View 3 Replies View Related

Forms :: Default Formatting Option In Conditional Formatting Dialog?

Aug 1, 2014

Need to confirm whether the Default formatting option in the Conditional formatting Dialog won't work in datasheet view of a form. Please note that all conditional criteria are working fine but not the Default Formatting option - only in the Datasheet view (In Single Form view the default formatting is working fine)

View 11 Replies View Related

Modules & VBA :: Separate Numbers And String From Alpha-numeric String

Jun 7, 2013

MS-Access VBA code to separate numbers and string from an alphanumeric string.

Example:

Source: 598790abcdef2T
Output Required: 598790

Source: 5789065432abcdefghijklT
Output Required: 5789065432

View 13 Replies View Related

String Validation (string Must Start With Http://)

Mar 12, 2007

Hi all,

I was looking for some help. I am trying to setup a table with a field for web address. People are entering www.website.com etc however I need them to make sure it starts with http:// Is their any way I can put validation on the field to make sure that this is entered? Or maybe I could use an input mask?

Any suggestions would be gratefully recieved.

Andy.

View 3 Replies View Related

Search For A String Within A String

Oct 27, 2006

I have a column called CPU_S within a table called workstation that contains sample text like P111 933

I want to use the update command to search the CPU_S column for entries that contain this in there string then add P3 to a column called CPU_N

So far I have the code below but I don't know how to search a column entry for a specific string within a string. Can this be done and how?


UPDATE workstations SET CPU_N = "P4"
WHERE CPU_S = ;

View 3 Replies View Related

Tab Formatting

Apr 13, 2006

Really simple one for all you folks out there, but I've just been struggling for 20minutes and thats it I've decided to to seek proffesional advice. Though its been said I need it in other areas of my life too (so my ex says but..), any way I digress.

I put a tab control on a form all I want to do is format the title of each individual Tab name, i.e. font size etc, type. Had a look at the properties but nothing there seems to register.

Is it possible?

View 6 Replies View Related

Tab Formatting

Apr 20, 2006

Hey do any of you guys know if its possible to change the colour of the tabs or set them as transparent in a form plz??? I know you can set the background as transparent, but i dnt know if you can do that to the actual tabs.

Thanks guys

Zaf

View 1 Replies View Related

Formatting..

Jul 20, 2005

Ok, don't know what I should title this problem as, but maybe you guys can help. The data stored on my table is formatted as Currency, however, when I Queue up the data, I also multiply it by a factor (exchange rate). Which turns the data into just a regular number. When I display this data on my form, I reformat it into Currencies again. However, when I click on the field, it shows the number in its raw format. How can I fix this so that when the user click on the field, they won't see the raw number but just regular Currency format? Much thanks in advance.

View 9 Replies View Related

Help With Formatting

Feb 5, 2007

Hi,

I am creating a database of private equity funds. I want to have a currency field for an input entitled fund size. However, I need to be able to display whether the size of the fund is in dollars or euros. How can customize a number/currency field to allow me to input the correct currency symbol?

Thanks

View 2 Replies View Related

Formatting

Nov 8, 2006

Hi
I have a database with multiple tables all linked together in various ways. I would like a master reset button that will delete every record in every table as well as resetting the auto number(s) back down to zero again. Can this be done and if so, how?
Thanks in advance.

Dave

View 9 Replies View Related

Help With Formatting

Mar 11, 2007

I'm trying to format a header in a report and need some help.

The following results in "Error" if placed as the Control Source :
=IIf(IsNull([Captain]),"","Captain:" & [Captain])

Is there another way to do this?

Essentially, I want to display the word "Captain: " followed by the name if there is an entry. If there is no captain, I want to display nothing.

Thanks for the help!

View 1 Replies View Related

Formatting

Aug 24, 2007

In my report the data shows patients and which unit they are in so in the detail section it shows something like this depending on how many records there are:

CVICU
CVICU
CVICU
MSICU
MSICU
NICU
STICU
STICU
STICU

I'm now modifying that report to show totals and I want to list the names of the units going across the page not down the page which shows all the records. I moved the field into a "Unit Footer" and now the report shows only one entry for each unit like this:

CVICU
MSICU
NICU
STICU

Within the Unit footer section I don't want the names of the units going down but across like this:

CVICU MSICU NICU STICU

I know there must be an easy answer but I've looked and work on it for so long I can't see what it would be. Any help would be GREATLY appreciated.

Thanks so much in advance.

View 3 Replies View Related

Formatting Due Dates

Apr 20, 2006

Hi,
Please see attachment. I have created a mini database which will hopefully help me in explaining the process.

Table1: Field1 - 8 rows/8 records

Form1: Field1 text box
So in this box I used conditional formatting to say- whenever the date is greater than 04/05/2006, turn red.
So now I scroll to record2, need to have new conditional formatting rules to apply to this record.
My understanding is that I can use the remaining 2 conditions for records 2 and 3.
But what about records 4,5,6 & 7.
For example in record 4 I need the date to be greater than 02/15/2006, and record 8 to be greater than 05/09/2006-and as you can see when you scroll down to record 8 it has already turned red because it is governed by the rules in record1!
Hopefully this makes sense!
Is there a way to get around this? Is conditional formatting the only way to achieve this?
If it's not what would I do?
Thanks in advance for your help!

Jcwishart

View 1 Replies View Related

Formatting A ZipCode

Sep 7, 2005

I am having trouble formatting a mailing label zipcode using the xxxxx-xxxx format.

I am using the =Trim([City]&","&[State]&" "&Format([ZipCode],"@@@@@-@@@@")) for Access 2002

My program is Access 1997-is there a different formula and why isn't the above working?

The zipcodes that have an extension come out right but the ones that don't have an extension come out like 6-8894

Any help would be appreciated!

View 3 Replies View Related

Access And Its Xml Formatting

Mar 7, 2006

hi all, first time poster, with an awkward question.

i'll save you my life story but suffice to say i'm just 3 weeks into a 6mnt work placement from college and i could do with a bit of help.

the company i'm working with has to generate an xml document (preferably with access) corresponding to this schema (http://www.ros.ie/schemas/eusavings/v1/schema.xsd)

the problem so far as i can make out is that when i import this xsd into ms access - i'm presented with a rediculous number of tables and in turn these are not related, i.e. there is nothing to say that the e-mail address table is associated with the header table. (having them in one table makes more sense to me, but i'm not an expert, all i know is i have to comply with this xsd.)

when the data is exported to xml format, it's meant to look like this:

<?xml version="1.0" encoding="UTF-8"?>
<EUSavings formversion="1" periodstart="01/07/2005" periodend="31/12/2005" language="E">
<HeaderDetails>
<PayingAgent>
<TaxNumber taxtype="4">1234567T</TaxNumber>
<PayingAgentName>
<NameDetails>Joe Bloggs</NameDetails>
</PayingAgentName>
<PayingAgentAddress>
<AddressLineDetails Type="Line1">Test Road</AddressLineDetails>
<AddressLineDetails Type="Line2">Test City</AddressLineDetails>
</PayingAgentAddress>
<PayingAgentCountryCode>
<CountryCode>IE</CountryCode>
</PayingAgentCountryCode>
</PayingAgent>
<FileSequenceNumber>1</FileSequenceNumber>
<PaymentYear>2006</PaymentYear>
<ContactDetails>
<ContactName>
<NameDetails>Paul O'Neill</NameDetails>
</ContactName>
<TeleNumber>
<TeleNumberDetails>0875252252</TeleNumberDetails>
</TeleNumber>
<EmailAddress>
<EmailAddressDetails>test@test.com</EmailAddressDetails>
</EmailAddress>
</ContactDetails>
</HeaderDetails>
<AccountDetails>
<DocumentType>1</DocumentType>
<AccountHolderDetails>
<FormType>A</FormType>
<KeyName>
<NameDetails>Jones</NameDetails>
</KeyName>
<OtherNames>
<NameDetails>Tom Paul</NameDetails>
</OtherNames>
<Address>
<AddressLineDetails>New Road</AddressLineDetails>
<AddressLineDetails>New City</AddressLineDetails>
</Address>
<AddressCountryCode>
<CountryCode>GB</CountryCode>
</AddressCountryCode>
<BeneficialOwnerResidenceCountryCode>
<CountryCode>FR</CountryCode>
</BeneficialOwnerResidenceCountryCode>
<BeneficialOwnerBirthDetails>
<DateOfBirth>01/01/1945</DateOfBirth>
<BirthCity>Paris</BirthCity>
<BirthCountryCode>
<CountryCode>FR</CountryCode>
</BirthCountryCode>
</BeneficialOwnerBirthDetails>
<PaymentType>0001</PaymentType>
<CurrencyCode>EUR</CurrencyCode>
<AmountPaid>8889</AmountPaid>
<AccountIdentifier>152525525</AccountIdentifier>
</AccountHolderDetails>
<ReferenceNumber>455200211</ReferenceNumber>
</AccountDetails>
</EUSavings>


everyone in this company is completely new to xml and seeing as i have a little experience with it from college i've got quite a bit of pressure on me to try and make this work.

so, my question is: how would i go about exporting data from access into a xml document which conforms to the xtd, and looks like the xml code above?

is access capable of doing this?

they want this solved programatically, but nobody here knows how to do it.

can anyone offer guidelines on how to tackle this? any help would be really appreciated, i'm in over my head

View 3 Replies View Related

Conditional Formatting

Apr 18, 2006

Hi Guys,

I've a question and I hope you can help me out.......
I'm trying to use Conditional Formatting Options on a Text box called "Date". I'd like that this box become Red if its value is between value1 from Text box "Start Date" and value2 from Text box "End Date" or Green otherwise (in this way the color change dynamically every time I change the values of Text Boxes "Start Date " and "End Date"). How can I do that? What I need to type in the Conditional Formatting Windows?

Thanks a lot for you help!!!!

Ciao Ciao

View 1 Replies View Related

Formatting Dates

May 31, 2006

I wondered if someone could point me in the right direction.

I am pulling dates from a table in the format:

7092000
11092000

How can I reformat to:

07/09/2000
11/09/2000

Thanks

Paul

View 10 Replies View Related

Number Formatting

Jun 28, 2007

I'm having an issue with the way my number fields are displayed on my form.

I want the number to be dislayed with 2 decimal places. I have formatted the numbers so that they are 'fixed' and specified 2 in the decimal places property but my numbers are rounding themselves down.

eg. I type 1.25 but it comes up as 1.00

Thank you in advance for your help.

View 3 Replies View Related

Conditional Formatting

Aug 13, 2007

Hello

On my Database I have used Conditional Formattion to change the colour of the qty to highlight when the qty is getting low however its not as good as I would hope as there are different type of definition of quantity (D of Q) e.g. Each (single items such as a screw) and Roll (such as cord and tape)

Conditional formatting doesnt work well because if I have it as less than 10 the qty is in red, its ok for the each items however not the roll as 10 rolls of tape is more than we would need.

I am just wondering if anyone knows what the code would be to change the colour depending on the qty and the D of Q

All i have got so far is:
If me.qty <10 and DofQ = EA then

Now im stuck for the change colour part

Any help would be great

View 13 Replies View Related

Conditional Formatting Help

Sep 2, 2007

Hi Guys,

I'm after an easy way on being able to change the colour of a field once it a certain figure is reached

For instance

Standard field colour for anything 1-99
100+ changes to red

Would any be able to help me out please?

View 2 Replies View Related

Formatting An AutoNumber

May 25, 2006

I am having trouble locating how I'd customize an AutoNumber.

I am trying to create an automated JOB #. This number would be Unique. But I want it to be displayed a certain way.

Basically I have two Departments that would be using this Database.

Each Department has a Unique Job #.

For the FOF Department the layout I am looking for is

FOF-####-2006

Department-job#-year

and the HeadQuaters

HQ-####-2006

The Job # is the Primary key with no duplicates/ hopefully automated.


Any ideas on how I can do this?

View 1 Replies View Related

Date Formatting

Jun 18, 2007

Can anyone help me please!!! I receive a csv file in which I need to import it into a table. It contains a date feild which looks like this '2007-06-15 12:17:54.953000000' and I would like it to look like this 'ddmmyyyy 00:00:00'. I have tried importing the data then changing the imported field to date and time format but it deletes it, and I have also tried to format it into a query using Format() but this is unsuccessful also. I have a work around which is to change the CSV file into excel, format it how I want it and then import, but ideally I would like it to skip that part.

Any Suggestions welcome:D

View 5 Replies View Related

Conditional Formatting

Sep 8, 2005

Does anyone know if there is a way in a report to display an entire row in a different color? I'm running a report based on a query and I need specific information to come up in RED. I read about conditional formatting but you can only apply it to a field in a report, but not to an entire row. Let's say I have a group of managers and I need to know the ones that are making more than $50,000 a year. I don't just want the salary to come in RED, I need the entire row (like name, last name, title, date of hire, salary, etc).
Any ideas?

thanks!

View 2 Replies View Related

Formatting A Parameter?

Mar 15, 2006

When using a query and asking for a user input, e.g. [Please enter a surname] - is it possible to design a form and link this to it ?

Shellie x

View 3 Replies View Related

Query On Formatting?

Aug 25, 2006

Crazy question. I have a form where i have set conditional formatiing for certain fields which changes the background color of a field if it doesn't meet certain criteria, signaling me that I need to followup. For example in a Yes/No field, if it's Yes it stays white background, if it's No, the background changes to yellow.

Is it possible to query/report/form to show only records where the fields are displaying the yellow background (perhaps in the form properties?)? I would not need to see a record if there are no fields with yellow. (NOTE: there are several fields for each record set with this conditional formatting and I would need to see the record if it has one yellow background field or five)?

I hope this makes sense to oyu.

Thanks!

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved