Re: Making use of a Passed Argument



Roger Carlson wrote:
If ServiceN is a field or variable, then list it without the quotes:

DoCmd.OpenForm "frmStaff_Entry", , , "Name = " & Chr(34) & Me.Namex &
Chr(34), , , ServiceN

Right now, you are passing it the literal string "ServiceN". Without the
quotes, it will pass the value of the variable.


Just as a followup, 'Name' is a reserved word in Access. You shouldn't name (no pun intended) any of your fields or any other object with a reserved word. Sometimes it'll work, sometimes it won't. It really depends on what the code is trying to do.

That's probably not the problem here, but you should make the correction for the future anyway.

Here's a list of all the reserved words: http://support.microsoft.com/kb/q286335/

--
-D
Duncan Bachen
Director of I.T., Ole Hansen and Sons, Inc.
.



Relevant Pages

  • Re: Dlookup and update not working correctly
    ... resources you would recommend for figuring out this kind of syntax? ... You need to put the variable outside the quotes. ... reserved word and will be confused with the VBA function. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Functions with Dlookup?
    ... Is VanID a text ... you need quotes around the value). ... BTW, Date is a bad choice for a field name: it's a reserved word, and using ...
    (microsoft.public.access.gettingstarted)
  • Re: Date format to display month name
    ... just put full quotes around the ... (a Reserved word) ... except in your labels and captions ...
    (microsoft.public.access.queries)
  • Re: Is "From" a legal col name.
    ... This is not really a java question, but java is my platform so I'm ... Is "From" a legal column name? ... if you use a reserved word as an identifier you have to quote it with double quotes: ... Note that most DBMS are case-sensitiv when using double quotes, so maybe in your case it should read: ...
    (comp.lang.java.databases)