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 strongm 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 Table Frame view with mouse double click

Status
Not open for further replies.

wswain

Technical User
Nov 1, 2003
21
US
We would like to view our database in a table view form. When we find a record of interest we'd like to double click on the row for the record that opens a form view of the record to get to all the memo fields and child table info as a table frame to the parent record.

i.e. view customers in table frame view. Double click customer of interest and new form with address, etc in a form view and on the same form is a tableview of that customers orders.

Thanks,
Bill
 

You can't attach code to a tableview.

Is that your question?

Or are you talking about a tableframe on a form?

Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 
If you're talking about a tableframe, then this code may help. It is attached to "MouseDouble" in the object explorer for the 1st field in the tableframe. It takes the order number from that field and opens a new form with all the details of the order. Obviously you will need to change the names of your tables, fields and forms to suit but it does seem to work very nicely.

var
frm form
orderNum number
tc Tcursor
endvar

orderNum=custorder.value

if isedit() then endedit() endif
tc.open("Temp1")
if orderNum.isBlank() = false then
if tc.locate("custorder",orderNum) then
if tc.qlocate(orderNum) then ; use qlocate if client # is the primary key field, much faster.
frm.open("orderentry")
frm.custorder.movetorecord(tc)
;frm.custorder.setRange(orderNum) ; use setrange to keep the user from moving off the record
else
MsgStop("Error",ordernum.string()+" "+"Is Not a Valid Number")
endif
endif
endif
tc.close()

Lewy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top