Transport record value

H

Harmannus

Hallo,

I have a form/table with holiday hours.

How can i transport the value of the field HolidayOld of record 1 to the
field HolidayNew of record 2 etc.

Thanx for any tips!

Regards,

Harmannus
 
B

Bas Cost Budde

Harmannus said:
Hallo,

I have a form/table with holiday hours.

How can i transport the value of the field HolidayOld of record 1 to the
field HolidayNew of record 2 etc.

Thanx for any tips!

Regards,

Harmannus
You are probably looking for the DefaultValue property of a Form control.

* create an AfterUpdate event handler for HolidayOld, with in its body:
HolidayNew.DefaultValue = HolidayOld.Value
 
H

Harmannus

Thanx,

I tried your suggestion but can't get it to work. Could you be more specific
or do you have other suggestions?

---
You are probably looking for the DefaultValue property of a Form control.
* create an AfterUpdate event handler for HolidayOld, with in its body:
HolidayNew.DefaultValue = HolidayOld.Value
---

Doe you mean the after update event of the form or of the field Holiday old?

Thanx for any replies..

Regards,

Harmannus
 
B

Bas Cost Budde

Harmannus said:
Thanx,

I tried your suggestion but can't get it to work. Could you be more specific
or do you have other suggestions?

AfterUpdate will fire only if the control is bound, ie it has a
controlSource (that is usually the case). You could alternatively use
the Exit event, which fires when you take the focus off the control.

What exactly did you try? Don't forget to set the AfterUpdate (or
corresponding) property of the *control* to [Event Procedure] or the
code will not run.
Do you mean the after update event of the form or of the field Holiday old?

The afterUpdate for the *field*.

Volhouden!
 
F

Fred Boer

Yes, it is... Bas was very helpful to me once, and we don't have nearly
enough people of Dutch descent around here! Now there's Bas and me and ... ?

Now, I'd like to say hello in Dutch to you Bas, but I only know some
prayers, a few swear words, and an off-colour song about Fresians. <g>

Tot Ziens!
Fred Boer
 
B

Bas Cost Budde

"Welkom terug" is our equivalent for welcome back. But I take the hello
anyway :) and that is simply hallo in Dutch.

Fred said:
Yes, it is... Bas was very helpful to me once, and we don't have nearly
enough people of Dutch descent around here! Now there's Bas and me and ... ?

Now, I'd like to say hello in Dutch to you Bas, but I only know some
prayers, a few swear words, and an off-colour song about Fresians. <g>

Tot Ziens!
Fred Boer


[snipped]

Hey, everybody, look who's back!

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
F

Fred Boer

Sorry, earlier message poorly written...

I meant... Yes, it is nice to see Bas back again...

Fred

Fred Boer said:
Yes, it is... Bas was very helpful to me once, and we don't have nearly
enough people of Dutch descent around here! Now there's Bas and me and ... ?

Now, I'd like to say hello in Dutch to you Bas, but I only know some
prayers, a few swear words, and an off-colour song about Fresians. <g>

Tot Ziens!
Fred Boer


Dirk Goldgar said:
[snipped]

Hey, everybody, look who's back!

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
H

Harmannus

Hallo,

Used the after update event and the exit event.

Still a no go ;-(

I used: HolidayNew.DefaultValue = HolidayOld.Value in the After update event
of the HolidayOld field.

Nothing hapens if i make a new record. If i change a record and choose new
#name?# appears in the Holiday new field...

To point out the problem again: i have a table that i use to calculate how
much holiday days i have left. On adding and substrating the days that are
left are shown in the Field HolidayOld. On adding a new record i want to
transport this value to the field HolidayNew.

<off topic>Zeker volhouden ;-) Kost mij aardig wat hoofdbrekens. Dacht dat
doe ik even: dus niet...</off topic>

Regards,

Harmannus



Bas Cost Budde said:
Harmannus said:
Thanx,

I tried your suggestion but can't get it to work. Could you be more specific
or do you have other suggestions?

AfterUpdate will fire only if the control is bound, ie it has a
controlSource (that is usually the case). You could alternatively use
the Exit event, which fires when you take the focus off the control.

What exactly did you try? Don't forget to set the AfterUpdate (or
corresponding) property of the *control* to [Event Procedure] or the
code will not run.
Do you mean the after update event of the form or of the field Holiday
old?

The afterUpdate for the *field*.

Volhouden!
 
B

Bas Cost Budde

Yep, should have put quotes around the value. I guess, that is, the
field is string type?

The code should read:
HolidayNew.DefaultValue = "'" & HolidayOld.Value & "'"
Nothing hapens if i make a new record.
Nah, what'd you expect?
If i change a record and choose new #name?# appears in the Holiday new field...

That's my pointer. (I do that myself.)
To point out the problem again: i have a table that i use to calculate how
much holiday days i have left. On adding and substrating the days that are
left are shown in the Field HolidayOld. On adding a new record i want to
transport this value to the field HolidayNew.

Maybe that structure is broken. Would it not be sufficient to store just
the mutation? You're invited for a (Dutch) discussion over email, please
note my domain is not org but ennel.
<off topic>Zeker volhouden ;-) Kost mij aardig wat hoofdbrekens. Dacht dat
doe ik even: dus niet...</off topic>

Waht, effe een databeesje bouwen? Take your time, it will pay off.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top