mramirez18
Posts: 56
|
| Posted: 05/30/2006, 7:42 PM |
|
I need assistance with DLOOKUP, I have tried some of the examples and get it to work.
I have a label which is showing the ID, and i want the actual name showing rather than the ID.
Table licenseallocate_type
Field license_allocate_name
the primary key for this table is license_allocate_type_id
This is what I currently have:
DLookup @35-E3FFC1F4
License_Allocate_Type_Name.Value = CStr(CCDLookUp(License_Allocate_Name,LicenseAllocate_type,License_Allocate_Type_id,DBlicensemgr))
'End DLookup
I get the following error
Variable is undefined: 'License_Allocate_Name'
What is the best way to do a DLookup for such a scenario?
|
 |
 |
marcwolf
Posts: 361
|
| Posted: 05/30/2006, 11:35 PM |
|
Hi There.
I think from looking at your code you will need to put the fieldsnames into a string
i.e.
DLookup @35-E3FFC1F4
License_Allocate_Type_Name.Value = CStr(CCDLookUp("License_Allocate_Name","LicenseAllocate_type",
"License_Allocate_Type_id = '" & License_Allocate_Type_Name.Value & "'" ,DBlicensemgr))
'End DLookup
I can see you are using the ACTION functionality so just put "" around your fields.
Now - from what I am reading..
The field from the table you want to return is License_Allocate_Name
The Table is LicenseAllocate_type
And the criteria is License_Allocate_Type_id equalling the inital value of
License_Allocate_Type_Name.Value
Let me know if this is corrent and it is working.
Personally I prefer to use the Form BeforeShow to do these substitutions.
Take Care
Dave
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
|
 |
 |
|