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!

Why does this work? But THIS DOESN'T ????????

Status
Not open for further replies.

chrisbee

Technical User
Oct 13, 2001
67
GB
Hi

I am calling a posicoding function from an Access Form. To get an address I need to present part of the address to the function...i.e.TEKAPO, JE3 2EN as in....

rc = PCUTILS.PC_RapidAddress(Nz("TEKAPO, JE3 2EN", ""), recno, dpno)

That works just great..

So why doesn't this.....

Public TheAdd as string
TheAdd = Forms!manifest2!Address1 & ", " & Forms!manifest2!PostCode
rc = PCUTILS.PC_RapidAddress(Nz(TheAdd, ""), recno, dpno)

When I check TheAdd the value is as you would expect i.e. "TEKAPO, JE3 2EN"


So what's that all about?
 
It just says - Postcode and premise found ....but if EXECTLY the same data is entered in quotes as opposed to a string, it finds it...and the string has retained its value at the function!????
 
Hi

Could the problem be that the Function is updating the passed string. It cannot update a literal, but it can update a passed string

Do you have a specification for the Function which explains passed parameters and returned value(s)

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
short PC_RapidAddress( char *addr,
char *hitsstr,
char *recnostr,
char *dpnostr,
short numlen,
char *pcd,
short pcdlen,
char *prem,
short premlen)


Parameters

addr
Input premise (optional) and postcode (mandatory)

hitsstr
Buffer into which a numeric string is copied, being the number of records in the recordset/hitlist produced by the search.

recnostr
Buffer into which a numeric string is copied, being the number of the best matching record in the resultant hitlist. This value is only valid for return codes of 0, 1 or 2, i.e. where a single matching address has been located.

dpnostr
Buffer into which a numeric string is copied, being the numeric ID of the matching delivery point in the matching record. Only valid for return code of 0, i.e. where a single matching address has been located.

numlen
The length available for each of the three fields hitsstr, recnostr and dpnostr. Each string should be at least 10 characters to avoid possible data loss. This parameters should likewise be at least 10

pcd
Output buffer into which the "cleaned" postcode will be copied. The "cleaned" postcode will be the input postcode after processing to correct minor typing errors etc. and formatted with one space between outcode and incode. It represents the actual postcode used during the search.

pcdlen
Length of the postcode buffer pcd. This buffer should be at least 9 characters

prem
Output buffer into which the premise information (as extracted from the input address string addr) is copied. Should be about 100 bytes long for most purposes: but it depends on the length of the premise part of the input address addr.

premlen
Length of the output buffer




And My Function is:-

rc = PCUTILS.PC_RapidAddress(Nz([TheAdd], ""), recno, dpno)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top