Open form as dialog, with focus on current record

TTSKevin

New member
Local time
Yesterday, 23:23
Joined
Nov 23, 2009
Messages
5
Hi

In short, im doing a db with a form with no edit properties enabled. It lists records in a subform, filtered using several combo-boxes.

I want to create a dialog that opens to edit the current record selected using record selectors in the subform.

Anyone know how to?

All i get it to do is to go to the first record. Ive got a combo on the dialog making it possible to select any record, but i want it to pop up with the current record selected as mentioned.

Thanks!

kevin
 
You need to use the WhereCondition of the DoCmd.OpenForm, your command will look something like;
Code:
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "FRM_YourEditFormName"
    
stLinkCriteria = "[RecordID]=" & Me![ControlTHatHoldRecordID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
 
Thanks John,

Im not all into vb-code yet, but i think i see what you mean.

Im not shure what control to use as [ControlTHatHoldRecordID]

My subform is set up as a continuous form. with the record selectors on the left.

The subform displays records corresponding with filter applied using several combos, running "live", iaw as soon as any of the combos are changed, the subform is requeried, and updates.

I'd like to be able to mark a record on the sub using the recordselectors, and then open this record in a nev dialog-form to edit.

The dialog is linked to the main table, not the query used to filter though. Don't know if it means anything in this context.

I guess i have to apply a invisible text box in the form, and use some kind of set value action whenever the record selectors are used, and refer to the textbox in your code?

I'm also abit confused regarding the function of the record selectors, so if someone could give me the brief vertion, i'll be thankfull.

Thanks!

Kevin
 

Users who are viewing this thread

Back
Top Bottom