473,242 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,242 software developers and data experts.

Repeat value of previous record field into current corresponding field

Hi
I've been using the 2 year old link below to repeat values from previous record field into current corresponding field. It's worked fine for text but the last piece of advice was to use the same logic for a date field. i.e.

theValue.defaultvalue = "#" & theValue.value & "#"

I can't get this to work for some reason and I can't figure out why. Can anyone out there help?

Thanks

Repeat value of previous record field into current corresponging field
--------------------------------------------------------------------------------

Something really common I'm sure and I'm surprised it's not just a field
property option.

The previous record's field value can be retrieved and copied into the
current corresponding field by the operator hitting CTRL+APOSTROPHE on the
new field but I would like this to occur with the user having to strike any
keys.

Suggestions?

Thanks,

Loren




--------------------------------------------------------------------------------

Report
Bas Cost Budde
Guest
n/a Posts November 13th, 2005
06:07 AM
#2


Re: Repeat value of previous record field into current corresponging field
--------------------------------------------------------------------------------

lorendi@internet.com wrote:[color=blue]
> Something really common I'm sure and I'm surprised it's not just a field
> property option.
>
> The previous record's field value can be retrieved and copied into the
> current corresponding field by the operator hitting CTRL+APOSTROPHE on the
> new field but I would like this to occur with the user having to strike any
> keys.[/color]

It *is* a field property.

In the AfterUpdate event of the control (let's say it is called
theValue), put

theValue.defaultvalue = theValue.value

If theValue is text, do this:

theValue.defaultvalue = "'" & theValue.value & "'"

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea


--------------------------------------------------------------------------------

Report
Guest
n/a Posts November 13th, 2005
06:09 AM
#3


Re: Repeat value of previous record field into current corresponging field
--------------------------------------------------------------------------------

On Mon, 06 Dec 2004 08:11:42 +0100, Bas Cost Budde
<b.costbudde@heuvelqop.nl> wrote:
[color=blue]
>lorendi@internet.com wrote:[color=green]
>> Something really common I'm sure and I'm surprised it's not just a field
>> property option.
>>
>> The previous record's field value can be retrieved and copied into the
>> current corresponding field by the operator hitting CTRL+APOSTROPHE onthe
>> new field but I would like this to occur with the user having to strike any
>> keys.[/color]
>
>It *is* a field property.
>
>In the AfterUpdate event of the control (let's say it is called
>theValue), put
>
> theValue.defaultvalue = theValue.value
>
>If theValue is text, do this:
>
> theValue.defaultvalue = "'" & theValue.value & "'"[/color]

Ah yes, that did it!

Thank You very much.

LB


--------------------------------------------------------------------------------

Report
Guest
n/a Posts November 13th, 2005
06:59 AM
#4


Re: Repeat value of previous record field into current corresponging field
--------------------------------------------------------------------------------

On Mon, 06 Dec 2004 16:36:24 -0600, <lorendi@internet.com> wrote:
[color=blue]
>On Mon, 06 Dec 2004 08:11:42 +0100, Bas Cost Budde
><b.costbudde@heuvelqop.nl> wrote:
>[color=green]
>>lorendi@internet.com wrote:[color=darkred]
>>> Something really common I'm sure and I'm surprised it's not just a field
>>> property option.
>>>
>>> The previous record's field value can be retrieved and copied into the
>>> current corresponding field by the operator hitting CTRL+APOSTROPHE on the
>>> new field but I would like this to occur with the user having to strike any
>>> keys.[/color]
>>
>>It *is* a field property.
>>
>>In the AfterUpdate event of the control (let's say it is called
>>theValue), put
>>
>> theValue.defaultvalue = theValue.value
>>
>>If theValue is text, do this:
>>
>> theValue.defaultvalue = "'" & theValue.value & "'"[/color]
>
>Ah yes, that did it!
>
>Thank You very much.
>
>LB[/color]

The above event/code worked fine for a text type control but not for a date
type. Can someone please tell me what to use to propagate a date field?

Thanks.


--------------------------------------------------------------------------------

Report
jv
Guest
n/a Posts November 13th, 2005
07:00 AM
#5


Re: Repeat value of previous record field into current corresponging field
--------------------------------------------------------------------------------

same concept, except with # signs
theValue.defaultvalue = "#" & theValue.value & "#"
Apr 17 '07 #1
1 4307
MMcCarthy
14,534 Expert Mod 8TB
This questions is being moved to the Visual Basic forum.

ADMIN
Apr 17 '07 #2

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

Similar topics

4
by: Jack | last post by:
Hi, I have a checkbox the value which goes to a database via a asp page that builds the sql string. In the front end asp page, the checkbox code is written as follows: <i><input...
4
by: Gene | last post by:
When entering a record in a form, I would like a value in a field of the previous record to be entered automatically into a different field of the current record. Which way should I go? Is it also...
3
by: William Wisnieski | last post by:
Hello Again, I'm really stuck on this one.....so I'm going to try a different approach to this problem. I have a query by form that returns a record set in a datasheet. The user double...
3
by: Phil | last post by:
Newbie to Access so am having a BIT of difficulty. I am trying to get a field value in a new record to equal the value of the same field of a previous one. For instance, Field1 + Field2 =...
4
by: | last post by:
Something really common I'm sure and I'm surprised it's not just a field property option. The previous record's field value can be retrieved and copied into the current corresponding field by...
2
by: MLH | last post by:
Fields in MyTable: PostID PostDate RollQtyXfer RollDenomination RollCount37 RollCount23
17
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I get the value of a form control? -----------------------------------------------------------------------...
8
by: Jeff | last post by:
A client wants a press of the Enter key in a field on a continuous form to grab the value of that field from the previous record. But if they have typed a value and then hit Enter it shouldn't. ...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.