Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to execute a query?

Status
Not open for further replies.

goobil

Technical User
Aug 9, 2003
38
AG
Hi all,
I'am new to VBA i have done some stuff bit i cant figer this one out.
I wjust want to get e record from the employeetype table.
How do i execute a query?



Dim DB As Database
Dim bankRs As DAO.Recordset
Dim employeeRS, emptypeRS As DAO.Recordset
Dim xemployeetype As String

Set DB = CurrentDb


Set emptypeRS = DB.OpenRecordset("employeetype", dbOpenDynaset)
emptypeSQL = "Select * From employeetype where ID = '" & Me.employeetype & "' "
'Set emptypeRS = emptypeDB.OpenRecordset("select employeetypeID from employeetype where " & _
"[ID] = '" & Me.employeetype & "'", dbOpenDynaset)
Set emptypeRS = DB.OpenRecordset(emptypeSQL)
 
docmd.runquery "queryname" ?
hope this helps

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top