From: John W. Vinson on
On Tue, 8 Jul 2008 22:53:02 -0700, jerseygirl54
<jerseygirl54(a)discussions.microsoft.com> wrote:

>I keep getting an error message after this statement. I tried to put he
>parenthesis after, before, and still get error. Compile Error: Expected:
>list separator or )
>
>I did:
>If Not IsNull(Me[cboOfficer])

Missing a period:

If Not IsNull(Me.[cboOfficer]) Then
<rest of the code>
--

John W. Vinson [MVP]
From: jerseygirl54 on
I still get an error. This time it's:

Compile error: Expected: Then or GoTo

"John W. Vinson" wrote:

> On Tue, 8 Jul 2008 22:53:02 -0700, jerseygirl54
> <jerseygirl54(a)discussions.microsoft.com> wrote:
>
> >I keep getting an error message after this statement. I tried to put he
> >parenthesis after, before, and still get error. Compile Error: Expected:
> >list separator or )
> >
> >I did:
> >If Not IsNull(Me[cboOfficer])
>
> Missing a period:
>
> If Not IsNull(Me.[cboOfficer]) Then
> <rest of the code>
> --
>
> John W. Vinson [MVP]
>
From: jerseygirl54 on
Don't know where I went wrong, but I don't have the Roster to pick. I have
the "SELECT DISTINCT" in the unbound combobox Row Source. What could I be
doing wrong?

"Ken Sheridan" wrote:

> Oops, missed a closing parenthesis:
>
> ' only do the search if a name has been selected
> If Not IsNull(Me[cboOfficer]
>
> Ken Sheridan
> Stafford, England
>
From: John W. Vinson on
On Tue, 8 Jul 2008 23:29:00 -0700, jerseygirl54
<jerseygirl54(a)discussions.microsoft.com> wrote:

>I still get an error. This time it's:
>
>Compile error: Expected: Then or GoTo

Correct the error in your code. If you would like help doing so please post
your code (multiple lines).

My suggestion was how to correct the *syntax of part of one line*. What I
posted was not the code in its entirity (since I don't know what you're trying
to do it would be a bit hard to do so...)
--

John W. Vinson [MVP]
From: jerseygirl54 on
Dim strCriteria As String

'only do the search if a name has been selected
If Not IsNull(Me.[cboOfficer]) <---This is where I get an error "COMPILE
ERROR: THEN OR GOTO
'build criterion for search
strCriteria = "[Officer ID]=" & Me.[cboOfficer]

'open form filtered to selected person
DoCmd.OpenForm "frmOfficerRoster", WhereCondition:=strCriteria

'close dialogue form
DoCmd.Close acForm, Me.Name
Else
'otherwise inform user
MsgBox "No officer selected.", vbInformation, "Invalid Operation":

End If

"John W. Vinson" wrote:

> On Tue, 8 Jul 2008 23:29:00 -0700, jerseygirl54
> <jerseygirl54(a)discussions.microsoft.com> wrote:
>
> >I still get an error. This time it's:
> >
> >Compile error: Expected: Then or GoTo
>
> Correct the error in your code. If you would like help doing so please post
> your code (multiple lines).
>
> My suggestion was how to correct the *syntax of part of one line*. What I
> posted was not the code in its entirity (since I don't know what you're trying
> to do it would be a bit hard to do so...)
> --
>
> John W. Vinson [MVP]
>
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5
Prev: Auto-Fill a Form
Next: Relationships and lookup tables.