Opening a new linked form gives #Name error

Is that what you had? Upon reviewing your posts I can't find where you were using that otherwise I wouldn't have suggested it at such a late stage. Thanks dbg - it's there in web docs as well. I missed it.

So the explanation is that OpenArgs of text type have to be delimited same as if you were trying to pass a literal string to a control, such as "apple"?

Not me Micron, Lanser was the o/p.
I was just trying to get to the bottom of the problem.

Lanser was just assigning OpenArgs on it's own.
 
Just realised that is you wanted to add more than one record at a time, you would need defaultvalue?
And the other thing is if the users change their minds and simply closed the new form, you could get left with an empty record if you didn't use the default value property.
 
Last edited:
@Gasman; I realize you weren't OP but I read

However I'd still go with my method, just for a little less typing, but good to know about.
Me.DocRef.DefaultValue = """ & Me.OpenArgs & """

as if it was your method. Not sure what your method is - perhaps just assigning to the vale property then. dbg makes a good point about possible incomplete record.
 
Last edited by a moderator:
My method was just to set the control value to the OpenArgs, not it's DefaultValue, however I have since realised that in some circumstances that would not be the best way.

That is how I have done it in the past, with Esc to cancel a new record.
 
Knew something didn't look quit right...actually that has to be

Me.DocRef.DefaultValue = """" & Me.OpenArgs & """"

or else the Default Value you'll end up with will be

& Me.OpenArgs &

not the passed value.

Linq ;0)>
 
I do not know what to say, I copied the code I posted straight from the form.?

DB is attached. Form NewVerForm
 

Attachments

Knew something didn't look quit right...actually that has to be
Me.DocRef.DefaultValue = """" & Me.OpenArgs & """"
Linq ;0)>
Hmmm - don't know why. What I posted worked for me
"'" & Me.OpenArgs & "'"
 
Surprisinghly...what you just posted

" ' " & Me.OpenArgs & " ' "
does, indeed, work! As well as my code

"""" & Me.OpenArgs & """"

but the original code, which was co-opted from Access Help, was

" " " & Me.OpenArgs & " " "

with three Double Quotes on each end...which doesn't work, as I noted...instead of Double Quote - Single Quote - Double Quote, which does.

Is anyone surprised that Access Help got it wrong?

Linq ;0)>
 
I do not know what to say, I copied the code I posted straight from the form.?

DB is attached. Form NewVerForm

Running the code in your posted file...using

""" & Me.OpenArgs & """

with 3 Double Quotes, on either end

produces

& Me.OpenArgs &

in the Control, as I said...not the appropriate DocRef.

Linq ;0)>
 
My apologies,
I had created a new form in case the form was corrupted and was still using that, with my original Load method. :banghead::banghead:

Running the code in your posted file...using

""" & Me.OpenArgs & """

with 3 Double Quotes, on either end

produces

& Me.OpenArgs &

in the Control, as I said...not the appropriate DocRef.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom