PC Review


Reply
Thread Tools Rate Thread

I am trying to get a form to pick up the record data from a different record to this new record

 
 
Thomas Simsion
Guest
Posts: n/a
 
      10th Nov 2003
I have a sub with two records Service date and next service date I would
like to be able to fill in service date from the previous record next
service date Can it be done.


 
Reply With Quote
 
 
 
 
=?Utf-8?B?TGFycnkgU21pdGg=?=
Guest
Posts: n/a
 
      10th Nov 2003
This may be the same problem I am trying to solve. I am using the Inventory program that comes as an example with Office 2000. For the way we do business I have items in inventory with pricing. When I want to make a Purchase Order I want to select an item and then have Access fill in the Price that corresponds to the item on the Purchase Order. Have you gotten any feedback from your question?
 
Reply With Quote
 
mikepage5
Guest
Posts: n/a
 
      10th Nov 2003
I normally have mine set the text box with the date you
wish to be automatically updated to the service date
default setting set to the max date of that particular
records previous entries, ie service date max as default
entry for the text box and not the table. I have my
current project set to put in the previous mileage of a
vehicle based off of the max mileage previously entered
into the previous mileage text box of the current entries
form. There is much more to mine but hopefully this
helps.
>-----Original Message-----
>I have a sub with two records Service date and next

service date I would
>like to be able to fill in service date from the

previous record next
>service date Can it be done.
>
>
>.
>

 
Reply With Quote
 
Tony Vrolyk
Guest
Posts: n/a
 
      10th Nov 2003
Not sure if there is a better way but this just popped in my head.

Create variables for each of the controls you want this to effect. Have the
variables assinged to the curent value On Current. Then Before Insert,
assign the variable's value to the appropriate controls.

The Before Insert doesn't fire until you actually start typing something so
the new record will initially be blank. You could have your own custom New
button to have the controls filled in before actually starting typing. In
this case you would then want to disable the New button so someone doesn't
repeatedly hit it and create a bunch of mostly blank records (we all have
those users who double-click everything)

**sample**
Option Compare Database
Option Explicit
Dim variable1 as whatever
Dim variable2 as whatever

Private Sub Form_Current()
if not me.newrecord
variable1 = me.text1
variable2 = me.text2
etc...
end if
exit sub

Private Sub Form_BeforeInsert(Cancel As Integer)
me.text1 = variable1
me.text2 = variable2
etc...
exit sub

**end sample**

Tony

"Thomas Simsion" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I have a sub with two records Service date and next service date I would
> like to be able to fill in service date from the previous record next
> service date Can it be done.
>
>



 
Reply With Quote
 
Kelvin
Guest
Posts: n/a
 
      10th Nov 2003
This is a good option except that this is based on the form so when you
close the form the default option vanishes. Another option is to use the
DLookup function but without knowing more about your table structure I can't
be more specific. Look at the help for the syntax.

Kelvin

"mikepage5" <(E-Mail Removed)> wrote in message
news:09d101c3a7a4$ed4b3530$(E-Mail Removed)...
> I normally have mine set the text box with the date you
> wish to be automatically updated to the service date
> default setting set to the max date of that particular
> records previous entries, ie service date max as default
> entry for the text box and not the table. I have my
> current project set to put in the previous mileage of a
> vehicle based off of the max mileage previously entered
> into the previous mileage text box of the current entries
> form. There is much more to mine but hopefully this
> helps.
> >-----Original Message-----
> >I have a sub with two records Service date and next

> service date I would
> >like to be able to fill in service date from the

> previous record next
> >service date Can it be done.
> >
> >
> >.
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy data from one record to a new record on a sub form =?Utf-8?B?RWNob3NwaWNl?= Microsoft Access Forms 4 19th Jul 2011 05:19 PM
Add a record or edit a record on a data entry sub-form? zufie Microsoft Access Queries 1 3rd Sep 2009 09:36 PM
Auto Populate new record form with an existing record's data =?Utf-8?B?SUx1dkFjY2Vzcw==?= Microsoft Access Reports 0 19th May 2006 05:04 PM
Can the form defualt on the new record for data entry rather then on the first record Mike Saifie Microsoft Access 4 9th Mar 2006 05:01 PM
How do I pick the previous record to use it in the next record ca. =?Utf-8?B?c25ha2U=?= Microsoft Access Getting Started 2 8th Feb 2005 12:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:47 AM.