Hello everyone, pls help
I have a table XYZ with option field.
The selected option determines which table will be use for lookup, and it works.
The problem is when i raise the lookup table, and select a record, a certain value is inserted in tbl XYZ in field2, and I would like automaticallly to fill one more field in tbl XYZ that appers in that lookup table.
Unfortunatly I don't have one primary key in the lookup tables - it's combination of two (one I am getting in field1, and the second I would like to have in field2).
Is it possible to solve this problem somehow, without adding unique primary key in the lookup tables.
TNX
0
Comments
Your explanation leaves much to my imagination... :-s
The update of your XYZ is done before, or after the lookup?
In general you could make a lookup routine of your onw in the XYZ record object and give the parameters you want.
If you call the lookup with a record parameter then you can get all the record the user has picked, by using the function GETRECORD.
I copy paste the code in the RUNMODAL (form) of the help:
Does it cover you? If not, why don;t you explain better and with steps... :roll:
Arhontis
https://forum.mibuso.com/search
When I do something like copy-paste of this code, I am getting message when I run table xyz ->lookup filed:'Tables are incomaptible'
I understand that...I think I don't need to settable view and rest.
But when I leave just this:
It opens lookup table without OK and Cancel button, so I can't do anything.
Now, I try to explain more my problem....and sorry if I was too short in explaination
I have table (so callled XYZ) with few columns. One column is an option filed that provides user to select:
or Item category ,
or Product group ,
or Item ,
This column determines the table realation for the next column, whic is code type. So if user select
or Item category -> this column is lookup on Item Category
or Product group -> this column is lookup on Product Group
or Item -> this column is lookup on Item
One more column that is important is so called "Level above", which supposed to contain code of the level above..if record contains "Product group " in option field, and Code of the "Product group", this field shoud have code of the "Item Category", that this "Product group" belongs to.
So problem is: when user select something in lookup table, field with code for example "Product group code" is filled with selected value. But filed "Level Above" is empty!!!
I would like to filled it, in the moment when "Product group code" is filled.
IS it possible?
I need to get whole record from lookup table, but how?
I hope u can help me!
The incompatibility error is strange, it means that the Rec inside the GETRECORD is not the same rec with the Source table of the form.
Anyway, make a form variable to your lookup form, make arecord variable to your XYZ table, then: And now in the vXYZrec variable you have the record the user picked on the lookup form.
The function LOOKUPMODE(TRUE) makes the OK and Cancel buttons visible on the form.
If this don't cover you, then you could make a few variables on your form and set them when the user picks something, and make a function in the form that gets some parameters (with var checked) and puts in those parameters the values that have been saved during the picking of the user. i.e.
Arhontis
https://forum.mibuso.com/search
It works!
First, I was trying on the table - not susscefull, after I tried on form, and it works.
I put this code on OnLookup
Key thing was this f.LOOKUPMODE(TRUE); I thought it's quite enough if I have Lookup Properties set OK.
Once again, thanks a lot!!!
I have the Don Kichot syndrom and mibuso gives me the opportunity to fulfill it. ](*,)
Arhontis
https://forum.mibuso.com/search
But the problem is time.
And as you can see sometimes I cannot solve my problems, not speak of other ones.
I find myself in a similar position to merana, I have the form open but have no OK or CANCEL buttons.
My variables are :
My filter appears OK as the data in the RUN form is correct.
Trying to learn from info in this thread, I am running from the form not the table.
Can anyone see what I am doing wrong.
Regards
SteveA
You are using a form that those buttons have been deleted because it is a subform.
Try using the form 516 as your lookup form or make your own.
Arhontis
https://forum.mibuso.com/search
Thanks for both the content and speed of your reply.
Regards,
SteveA
During a period of trial and error, before the kind reply from Arhontis, I got this to almost work.
I was able to get the OK and CANCEL buttons on the Sales Order Sub Form (ID46).
I am just interested why the buttons should be displayed under these circumstances.
Regards,
SteveA
First of all, if you have added the two buttons on the form 46 then you will have problems with the Sales Order form which uses that form to show the sales lines. You should use the form 516-Sales Line.
Eash button has properties and one of them is:
InvalidActionAppearance (Normal/Disable/Hide)
which on the OK and Cancel buttons (with the PushAction property is LookupOK and LookupCancel) is hide.
That is to hide the buttons whose action is inappropriate for the current action the form has been opened.
When the form is opened with lookupmode(true) then the two buttons appear.
Does this cover your question?
Arhontis
https://forum.mibuso.com/search
Thank you once again for your speedy help.
Regards,
SteveA