Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 21st, 2003, 06:08 PM
Authorized User
 
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default append to

is it possible to use something like the following to append text to a field instead of overwriting.

        .Edit
        !a2 = scost
        .Update
I would like to add "scost" to what ever might be there seperated by ~
eg
sretail~scost
in field a2

many thanks
 
Old June 22nd, 2003, 04:04 AM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
Not too sure what your trying to do but you could append by

        temp= !a2
        .Edit
        !a2 = temp & "scost"
        .Update

Regards
 
Old June 22nd, 2003, 04:29 AM
Authorized User
 
Join Date: Jun 2003
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, it might be useful (or not) to know that you can also concatenate in a batch update. just include in the update SQL:

UPDATE tablename SET a2 = a2 & 'scost';

and execute the command and every record in tablename will be updated.

If you keep running this command though, you will end up with scostscostscost...etc on the end of the a2 value :-)



Quote:
quote:Originally posted by [email protected]
 is it possible to use something like the following to append text to a field instead of overwriting.

        .Edit
        !a2 = scost
        .Update
I would like to add "scost" to what ever might be there seperated by ~
eg
sretail~scost
in field a2

many thanks
 
Old June 22nd, 2003, 04:37 AM
Authorized User
 
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for that.
will have to go with the (temp & "sCost")

although the sql would be faster, I'm just a beginner and don't know how to execute an update statement in code.

Thanks anyway





Similar Threads
Thread Thread Starter Forum Replies Last Post
Append Query bright_mulenga Access 1 January 3rd, 2007 01:33 PM
Append Query Cybersurfer Access 1 February 13th, 2006 01:02 PM
Open For Append As #1 rylemer Beginning VB 6 3 June 5th, 2005 03:27 PM
append query? bph Access 2 November 23rd, 2004 12:44 PM
append query stoneman Access 2 November 12th, 2003 09:17 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.