Hi I am newbie, can you please help me to create this query through vba -
SELECT [010710_pri].Field1, [010710_pri].Field2, [010710_pri].Field3, [010710_pri].Field4, [010710_pri].Field5
-
FROM 010710_pri
-
GROUP BY [010710_pri].Field1, [010710_pri].Field2, [010710_pri].Field3, [010710_pri].Field4, [010710_pri].Field5
-
HAVING (((Count(*))=1));
-
I want to create a make table query.
4 5719
Just change the type from SELECT Into "Make Table".
The type can be set in the header menu / Ribbon.
Nic;o)
Hi Nico,
Thanks for your reply, however my below mentioned command button is not working can you please take a look? -
Private Sub Command5_Click()
-
On Error Resume Next
-
Dim dbs As Database
-
Dim strSQL As String
-
Dim strQueryName As String
-
Dim qryDef As QueryDef
-
Set dbs = CurrentDb()
-
strQueryName = "Query1"
-
dbs.QueryDefs.Delete strQueryName
-
Set qryDef = dbs.CreateQueryDef(strQueryName, strSQL)
-
DoCmd.RunSQL ("SELECT [010710_pri].Field1, [010710_pri].Field2, [010710_pri].Field3, [010710_pri].Field4, [010710_pri].Field5" & _
-
"INTO 010710" & _
-
"FROM 010710_pri" & _
-
"GROUP BY [010710_pri].Field1, [010710_pri].Field2, [010710_pri].Field3, [010710_pri].Field4, [010710_pri].Field5" & _
-
"HAVING (((Count(*))=1));")
-
End Sub
-
Regards,
Sam
Just put the whole string into a query (open the SQL mode with the button top left), test it and finally save it and use in your code: -
currentdb.execute ("qryInsert")
-
I do have some hesitations about using a number as tabelname, try to start every table with "tbl" as a prefix !
Nic;o)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: teddysnips |
last post by:
Application is a Work Tracking/Timesheet database.
The increments of work are stored in the TimesheetItem table. This
contains, inter alia, the Work Code, the Start and the Duration that
the...
|
by: PC Datasheet |
last post by:
An Access user saw my name in a newsgroup and sent me a request for help on
a project. As part of the project, a list of the dates in a month was
needed. For anyone needing a list of dates in a...
|
by: Lyle Fairfield |
last post by:
MSDN Home > MSDN Library > Win32 and COM Development
Data Access
Microsoft offers many data access technologies to suit various
development needs. This section of the MSDN Library contains...
|
by: Owen Jenkins |
last post by:
Hi,
No-one replied to this when I sent it last week. Any bites out there today??
-----
My application allows users to create a new back end for separate
purposes. It does this by using Make...
|
by: KayCee |
last post by:
I am using Access 2000
I have three tables I am using to create a query that will be used for a data entry form. Table one - Client List, Table two - Services, Table three - Due Dates.
I want...
|
by: Mark |
last post by:
Hey folks, I'm looking at making the following query more efficient
potentially using the ranking functions and I'd like some advice from
the gurus. The purpose of the following is to have a...
|
by: gvijayasurya |
last post by:
11. What are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10)) ?
12....
|
by: creative1 |
last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
|
by: tekctrl |
last post by:
Environment; Win2K PC with 1Gb of RAM and plenty of HD space running Access
2002
Issue; Access presents a blank data entry form in the Forms view when the
New Record icon is used. However, it...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |