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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Form from Current Record in Subform: starts at first record

Status
Not open for further replies.

boxboxbox

Technical User
Apr 22, 2003
108
US
I have a form called JPGS which I'd like to keep in list form. I know I can display this as a datasheet, or in continuous forms so it looks like a datasheet. I have the onDblClick event set so if I click on any record, it opens up the same form in Single Form/Edit mode, which is how I want to enter data. It opens up to the record that I clicked on.

My problem is that I'd like to use this form (the datasheet/continuous view) as a Subform in a larger form,HBMain. When I double click, JPGS opens up to edit/enter data, but does not go to the "current" record, ie, the one I clicked on to open it up. I can set it to go to the first record, or the last, though if I set it for "next" it says I may be at the end of a record set and I have to CtlAltDel to get out of the error loop. Anyway.

I tried to use setvalue for the OnCurrent for the JPGS subform to synchronize the records, but that actually changed the record data on the HBMain form instead of just going to it. IE-I double clicked on record #5, it changed every record that I viewed in JPGS to be called #5. I tried using GoToControl for the OnCurrent, using the Offset argument to equal the double-clicked record on the HBMain form, but it won't let me use anything but integers.

Any ideas? Thanks...
 
When you insert the subform into the main form you have to set the relationship between the Parent(Main) form and the Child(sub) form, this is done from the subform property page in 2 rows:
Link Parent form
Link Child from
enter the common related field say EmployeeID or OrderID or similar.........

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
This could be a problem, as I didn't want the HBMain form to be bound to anything. Basically it's going to function like my startup screen, and I want headers and footer capability. I know I could use headers/footers on Continuous forms for JPEG, but I want to be able to see the Main form below, like with a pop up form, instead of just switching view modes...I guess I'll play around with that more, and see if I can put in some relationships on the HBMain form that are hidden...

Thank you
 
Even when I have the forms bound, with a one to many relationship, the current record is at the beginning on the popup form...blegh.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top