Retrieve Value selected by combobox from previous record

Agamemnon

Registered User.
Local time
Today, 03:39
Joined
Sep 18, 2003
Messages
24
Hello,

I have the following problem in Access 2002 and hopefully someone can help me out.

I've created a form that helps me for inputing product information.
The form retrieves information from different tables and queries and stocks the information in one table.


Now I want that for some objects on the form the value of the previous record is remembered so that I don't have to input that all the time (except if I want to change it).

The following objects should retrieve information on a previous record.

1) A list box Department
2) A Combobox with Attribute 1
3) A Combobox with Attribute 2 (cascaded)
4) A Combobox with Attribute 3 (cascaded)
5) An AxtiveX Control: Calender Wth Start Date
6) An AxtiveX Control: Calender With Start Date

It looks a very simple question to me, but I have no idea how to handle this kind of problem.

Thanks for your input,

Agamemnon
 
There are a few ways I would conside;

1. setting the default value at table level as a dmax (if you number your records sequentially) for each field you want a default value
2. Set the values at form level by using the Form_Current() event and screening for a new record
2a Using a recordset to get the last record's values and plugging them in
2b Using a Dmax to get the last record's values and plugging them in
 
Hi Fizzio,

Thanks for your quick response
You have to excuse me but I'm very novice in Access. Suppose I want to create the DMAX at table level, how do I have to do that.

Do I have to type in the field proporties DMax or ???

Thx

Agamemnon
 
Actually, I have reconsidered as Access does not lik the Domain Aggregate function as default values in tables, sorry.

In the controls of your form that you want default values, set their default value to the following.

=Dlookup("FieldtoCopy","TableName","IDField = " & Dmax("IDField","TableName"))

FieldtoCopy is the name of the field you are copying
TableName is the name of the table where the records are stored
IDField is your autonumber field for that table (sequential numbering)

hth
 
Thx It worked.
I only had to change comma's (,) in semi-comma (;)
Agamemnon
 

Users who are viewing this thread

Back
Top Bottom