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 / November 2005

Tip: Looking for answers? Try searching our database.

code error in subform - urgent your help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy - 30 Nov 2005 13:40 GMT
Hi there,

I have a main form and a subform, I trying a code in subform as below and
found a run-time error#3464 on the line of "Set rst =
db.OpenRecordset(strSQL)"

I am appreciate for your help in advance!!!!!

Private Sub LABOUR_NO_AfterUpdate()

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String

Set db = CurrentDb
strSQL = "SELECT * from [LABOUR TABLE] WHERE [LABOUR NO]=" & Me![labour no]

Set rst = db.OpenRecordset(strSQL)

Me![SALARY] = rst![DAILY SALARY]

rst.Close

End Sub
Klatuu - 30 Nov 2005 14:51 GMT
It is a syntax problem:
If [LABOUR NO] is text field:
strSQL = "SELECT * from [LABOUR TABLE] WHERE [LABOUR NO]= '" & Me![labour
no] & "':"
If it is a numeric field:
strSQL = "SELECT * from [LABOUR TABLE] WHERE [LABOUR NO]= " & Me![labour no]
& ":"

Note:  It is not a good practice to use spaces in names.  A better name
would be LABOUR_NO

> Hi there,
>
[quoted text clipped - 20 lines]
>
> End Sub
Andy - 30 Nov 2005 15:14 GMT
Hi Klatuu,

It is work now! Thanks so much!!!

> It is a syntax problem:
> If [LABOUR NO] is text field:
[quoted text clipped - 31 lines]
> >
> > End Sub
 
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.