Forum Discussion
ArshadKhwaja
9 years agoQrew Commander
I am trying to use the same approach but in my case I have two unrelated tables with one field in each that matches. So tried the following but no luck.
URLRoot() & "db/" & [_DBID_Customers]& "?a=dr&dfid=2&rid"& [Location No]=" &[Location No])
URLRoot() & "db/" & [_DBID_Customers]& "?a=dr&dfid=2&rid"& [Location No]=" &[Location No])
- MCFNeil9 years agoQrew CaptainYou have to know the Key field to find that is on the other table (i.e Record ID), If [Location No] is not the key field you cannot go directly to the record, but rather you will have to do query to find that [location no]
Syntax if Key field is [Location No]:URLRoot() & "db/" & [_DBID_Customers]& "?a=dr
Syntax if needing a query:
&dfid=2
&rid=URLEncode([Location No])URLRoot() & "db/" & [_DBID_Customers]& "?a=q&qid=1
&query={11.EX."&[Location No]&"}
(this is assuming your location fid in the new table is FID 11) - ArshadKhwaja9 years agoQrew CommanderThanks Matt. Location number is not a key field in both of these tables. I tried this as is by changing the FID but I am getting syntax error 'expected a valid expression after the "&".
In this formula where is it matching the location number with the table I am calling from? - MCFNeil9 years agoQrew CaptainWhat are your two DBIDs? _DBID_Customers & What?
What are the field IDs for the [Location No] on those two tables respectively?_ - ArshadKhwaja9 years agoQrew CommanderThanks, One is _DBID_CUSTOMERS and the other is _DBID_STORE_MIRROR. Field IDs are 40 and 8 respectively.
- MCFNeil9 years agoQrew CaptainFrom your Customer table you'd need a formula-URL field with the equations:
URLRoot() & "db/" & [_DBID_STORE_MIRROR] & "?a=q&query={8.EX."&[Location No]&"}"
From your store mirror it would be:URLRoot() & "db/" & [_DBID_CUSTOMERS] & "?a=q&query={40.EX."&[Location No]&"}"
Notice you are clicking the button from one table, but searching for the match in the other table - ArshadKhwaja9 years agoQrew CommanderFor now I used the statement for store mirror and this works great but it only shows the relevant record listed as a report. Any chance I could open a form?
- MCFNeil9 years agoQrew CaptainOnly if the field you are using for the query is the key field.
- ArshadKhwaja9 years agoQrew CommanderYes that is the issue. It is a key field in the table but not quite in the other.