Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get information fron other record ? 1

Status
Not open for further replies.

sippe

Technical User
Jun 24, 2004
10
FI
Hello

I have access program, where is many fields...
Everything else I can handle but copying field information from the record to next.

I have fields start and end, which include kilometers. I should copy info from end field to next records start field automatically when you take new record.

Is it possible and if it is how ?

I haven't used VBA before, but I'm studying it...

I'm gratefull if somebody could help me...

Sippe
 
Hi

JL: That link help me to copy whole record **(if I understood rigft) but...

I have numbers in my fields,
start number field
end number field

When I write in form first record info, I write both numbers. Next record should take to start number field info from previous records end number field. So while it is carrying information, it should change field where that info is, same time.
 
Way beyond my capabilities. Hopefully, though the smarties will understand more of what you want and can answer your questions now. I will continue to look around but I don't think I have ever seen anything do that before. JL
 
In the AfterInsert event property of the form:
Me![start number].DefaultValue = Me![end number].Value

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi

Nice to see that you give to me very soon answers. Thanks.

Thanks PHV. I think that is copying from one record in the same record. Am I right ?

Because I need to get that value from previous record, and only that one value, not all...

It would be so easy to meka this in excel, but I need this in access. This what I mean is in excel example

A1: start number (write)
B1: end number (write)
A2: =B1
B2: end number (write)
A3: =B2

If this make it clearly what I want to do.

Is in access something samekind than programming lanquages dynamic variables, which I can use like, previuos and next.

Sippe
 
If it is so easy in Excel, why not do it in Excel and then import the worksheet data into a table? JL
 
I think that is copying from one record in the same record. Am I right ?
No. It's preparing the new record as it's set the DefaultValue property.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi

Janetlyn: My customers aren't so used to do that conversion, and they have to use this forma everyday.

PH: I try, if I manage with yours help. Thanks

Sippe
 
Hmmm, it didn't work.

It took defaultvalue from first record, but it should every time change that defaultvalue to previous records value.

Is it even possible ?

Sippe
 
Hmmm, it didn't work.
In which event procedure have you coded my suggestion ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I put it first AfterUpdate event and then I tried to Click Event... but it always take first value not the previous.

What did I wrong? I believe it should work, but I'm "little" stubid this time. :-(
 
Little bit more information...

Now it change value, but it's same than same records value is, not the previous records value.

Can you say whats wrong with it still ?

Sippe
 
PHV said:
In the AfterInsert event property of the form:
Me![start number].DefaultValue = Me![end number].Value
Read carefully the 1st line


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
well, thats my problem... I'm from Finland and my access is finnish, so it's difficult to find that AfterInsert...

And when I only write it myself, nothing is working.

Sippe
 
In the properties of the form not any control, it would probably be number 3 from the top (on current, before insert, after insert).

But - when creating events, the property dialog migth be using local language, but when entering the event procedure, it should look like:

[tt]Private Sub Form_AfterInsert()

End Sub[/tt]

Roy-Vidar
 
Hi

RoyVidar: I have AfterUpdate, BeforeUpdate, Change 3 first events... and there isn't even AfterInsert event. How can it be ?

I have access 2003.

Sippe
 
You are looking at control events, take a look at the form events - the form events are in the order I described above in 2003 (click the "button" where the vertical and horisontal ruler meets to select the form properties).

Roy-Vidar
 
Thanks RoyVidar, now I found that, but it didn't work to me. Something is wrong still.

Perhaps this 2 am isn't best time to work, I continue in the morning and try to study from some book about that Event thing, why it's wrong still...

I'll be back after 8 hours.

Thanks to everybody who helped me, even I didn't manage finish that.



Sippe
 
Why not assign the value of your end number to a variable, then assign the value of the variable to the next start number?

The Missinglinq

"It's got to be the going,
not the getting there that's good!"
-Harry Chapin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top