Question?

Sato

Registered User.
Local time
Today, 20:29
Joined
Feb 27, 2003
Messages
14
Hi,

I have a auction db, in a form I have the object that is being sold with diferent fiels, and in a subform I have the various offers for that object (with fiels like date of offer, value, name of buyer...).

How can I select the record that as the highest bid (in the offers subform, the value field) and show the information of that offer in the initial form (object details), like the date of higher offer, value...

Hope it's clear!!!!

Sato
 
Try this. I think it should work, but I didn´t try it.
You need a field in your main form containing an identifier of the object (objectID) and a field or textbox or something to show the value(displayfield). You could probably use this as an on current event.
Code:
Dim rs1 as dao.recordset
Dim sID as string, sValue as string

sID=me.objectID
set rs1 = currentdb.openrecordset("select * from offertable order by bidfield desc;")
rs1.movefirst
sValue = rs1.fields("bidfield")
Me.displayfield = sValue

An easier way would be to just sort your subform descending on the bidfield. Of course, it wouldn´t be quite the same.

Fuga.
 
Ok, I´ve read your querstion again. You can use code to get the info into variables (like the sValue) and then assign them to fields (the me.displayfield = sValue line), but it seems to me it would be a lot easier just to have a subform (an additional one if you wish), linked via the objectID field, showing records one by one and sorted descending. You can easily make it look like it is on the mainform by removing lines, record selectors etc.

Fuga.
 

Users who are viewing this thread

Back
Top Bottom