Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2008

Tip: Looking for answers? Try searching our database.

Error 13 Frustration!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DubboPete - 27 May 2008 01:58 GMT
Hi all,

I have a problem with some code.  It keeps spitting back type
mismatch.   I have a similar thing to this in another database and it
works fine when fired by an option group-click.   Here's the code:

Private Sub Text27_AfterUpdate()

   If Me.Frame15 = 1 Then
           Me.FrmAssetSubform.Form.RecordSource = "SELECT assets2.[ASSET
NUMBER]," & _
    "assets2.[ASSET NAME], assets2.[ASSET TYPE], assets2.DEPARTMENT,
assets2.USER," & _
    "assets2.[DATE ACQUIRED] FROM assets2 WHERE (((assets2.[ASSET
NUMBER]) Like" & _
    "([Forms]![FrmAssetQuery]![text27]) & " * "))"
   ElseIf Me.Frame15 = 2 Then

               and so on...

Can't get past the first if me...then...statement.  Any clues anyone?

cheers
DubboPete
Dirk Goldgar - 27 May 2008 02:42 GMT
> Hi all,
>
[quoted text clipped - 17 lines]
>
> Can't get past the first if me...then...statement.  Any clues anyone?

It looks to me like you've got some bad quoting at the end of the SQL string
you're building.  Try this:

   If Me.Frame15 = 1 Then
        Me.FrmAssetSubform.Form.RecordSource = _
           "SELECT [ASSET NUMBER], [ASSET NAME], [ASSET TYPE], " & _
               "DEPARTMENT, USER, [DATE ACQUIRED] " & _
           "FROM assets2 " & _
           "WHERE [ASSET NUMBER] Like " & _
                   "[Forms]![FrmAssetQuery]![text27]) & '*'"
   ElseIf ...

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

DubboPete - 27 May 2008 04:16 GMT
On May 27, 11:42 am, "Dirk Goldgar"
<d...@NOdataSPAMgnostics.com.invalid> wrote:

> > Hi all,
>
[quoted text clipped - 36 lines]
>
> - Show quoted text -

Thanks Dirk, that cleared it up - but not before Access told me
there's an extra ) at the end, as in "[Forms]![FrmAssetQuery]!
[text27]) & '*'"
:-)
Dirk Goldgar - 27 May 2008 04:36 GMT
> Thanks Dirk, that cleared it up - but not before Access told me
> there's an extra ) at the end, as in "[Forms]![FrmAssetQuery]!
> [text27]) & '*'"

Sorry about that -- I thought I'd cleaned up all those extra parentheses
that the Access query designer insists on adding "just in case".

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

DubboPete - 27 May 2008 13:55 GMT
On May 27, 1:36 pm, "Dirk Goldgar"
<d...@NOdataSPAMgnostics.com.invalid> wrote:

> > Thanks Dirk, that cleared it up - but not before Access told me
> > there's an extra ) at the end, as in "[Forms]![FrmAssetQuery]!
[quoted text clipped - 7 lines]
>
> (please reply to the newsgroup)

no probs mate, thanks for the help....
Jan Baird - 27 May 2008 20:52 GMT
Jan Baird is out of the country until September 20.   Every effort will be
made to respond to messages, but please be patient.
Jan Baird - 27 May 2008 20:52 GMT
Jan Baird is out of the country until September 20.   Every effort will be
made to respond to messages, but please be patient.
Jan Baird - 27 May 2008 20:52 GMT
Jan Baird is out of the country until September 20.   Every effort will be
made to respond to messages, but please be patient.
Jan Baird - 27 May 2008 20:52 GMT
Jan Baird is out of the country until September 20.   Every effort will be
made to respond to messages, but please be patient.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.