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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenArgs Question

Status
Not open for further replies.

wdverner

Technical User
Mar 10, 2005
160
0
0
GB
hi All,
Is it possible to use two fields and pass using OpenArgs?

Dim strName As String

strName = Me.PriceList

DoCmd.OpenForm "frmPriceAdd", DataMode:=acFormAdd, WindowMode:=acDialog, _
OpenArgs:=strName

Currently I open frmPriceAdd and PriceList is passed across. However I would like it to open frmPriceAdd and pass over the PriceList and PartID that user is currently on.

Is this possible to use the two? And how can I adjust my code if possible?

Many thanks for your time and suggestions.
 
wdverner,

You can concatenate the values from the two (or more) fields into a delimited string (use something like a semicolon to seperate string values.

Then split the string up where ever needed. There are various ways to split the incoming OpenArgs string. The following is one approach:

If Len(strOpenArgs) > 0 Then
astrOpenArgs = Split(strOpenArgs, ";")

strFormName = astrOpenArgs(0)
strPKName = astrOpenArgs(1)
strPK = astrOpenArgs(2)

Cheers,
Bill
 
hi formerTexan,
How do I conctenate the two fields?...>>>

strName = Me.PriceList ; Me.PartID

it doesnt like that.... :(
 
Me.PriceList & ";" & Me.PartID

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top