problems with OPENARGS

  • Thread starter Thread starter Steven Malcolm
  • Start date Start date
S

Steven Malcolm

I am having troubles using openargs.

What I am doing is opening one form from another and using the openargs to
send a value which is the name of a field on a third form.

eg.DoCmd.OpenForm stDocName, , , , , , "txtFirstName"

when the user enters data in the called form and presses OK i want the data
to go to tthe third form in the text box called txtFirstName

eg Dim strFieldName As String

strFieldName = Me.OpenArgs


Forms![frmTempData]![strFieldName] = txtText

but when i try i get this message

Microsoft Access cannot find the field 'strFieldName' referred to in
your expression

Can anyone help me please


TIA


Steven
 
First, FrmTempData has to be open for this to work.

Change your code to this:
Forms!frmTempData(strFieldName) = txtText
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top