473,408 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

vb 6 vs excell

2
Hello all,
I've got 2 questions.
First question
If somebody know how to use data range. Meant that there's a date for a month. And every single day have own record. So I only want to know date from 12-16 September and it will displayed at data grid.
FYI, I already using this command and there's an error display
runtime error, type mismatch

dbEnq.RecordSource = " select * from Enquirer where Date > '" & Format("MM/dd/yyyy", txtDate1.Text) & "'" And " Date < '" & Format("MM/dd/yyyy", txtDate2.Text) & "'"
dbEnq.Refresh

On the form, there's a button, 2 textboxes, 1 adodc connected to database, 1 datagrid.

Second question
From the datagrid that displays, I want to export it to Excel document as a report.

I hope someone has solved this problem before.
Sep 24 '07 #1
4 1155
Killer42
8,435 Expert 8TB
First question
Use hash (#) delimiters around the date values, not quotes (').

Second question
No idea. Sorry.
Sep 26 '07 #2
Killer42
8,435 Expert 8TB
Oh, and I believe your parameters for the Format() function are all wrong. The first parameter should be the numeric or date value that you want to format, while the second shows what format to use. You appear to be giving it two strings, the first of which is the format.
Sep 26 '07 #3
jrtox
89
I've got 2 questions ...
Question 1:

Expand|Select|Wrap|Line Numbers
  1. dbEnq.RecordSource = " select * from Enquirer where Date > '" & Format(TxtDate1.Text, "mm/dd/yyyy") _
  2.  & "'" And " Date < '" & Format(TxtDate2.Text, "mm/dd/yyyy") _
  3.  & "'"
  4.  
  5. 'Format(TextName.Text, "mm/dd/yyyy")
Question 2:
No Idea
Sep 27 '07 #4
Killer42
8,435 Expert 8TB
Can I just point out, it might be better to use the Between operator rather than > and <.
Sep 27 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Savas Ates | last post by:
i cant delete data from excell which i use as a database with asp .. i encounter an error report about isam. how can i delete data from excell help meee!
2
by: alvis | last post by:
I need to write a windows service that will read a excell spreadsheet and either update a row in my sql db or insert the row. My question is how do i read excell spreadsheet row by row in VB dotnet
1
by: Mustafa | last post by:
I have an ASP script where i am generating the excell sheet dynamically i am passing some column header text which is long text so i want it to display it vertically in column (cell).In excell i...
1
by: Mustafa | last post by:
I have an ASP script where i am generating the excell sheet dynamically i am passing text as column heading which is long text so i want it to display it vertically in column (cell).In excell i...
2
by: Robert Halstead | last post by:
Hi guys, I have a asp.net web app and it's connecting to an excell 2003 document (in another folder) via OleDataAdapter. Everything works and all, it's just that when I shutdown IE and try to...
2
by: alvis | last post by:
hi i have a windows service that uses an excell workbook when i create the excell app i cant distroy it after i am finished i am using this code whats wrong? thanks Dim processes1(), p1 As...
0
by: Delforce | last post by:
Hi all, My application allows you to create a new excel file and then double click it in the list view to start it in excell. If the excell file is an existing one then I can start it now...
2
by: glibo | last post by:
I am trying to change the tab name when i open a excell spread sheet on the run time in c#. I changed it in the code: Response.AddHeader("content-disposition","filename=" + sFileName + ".xls");...
2
by: Bram2008 | last post by:
How to use macro in excel? Can i get some code to record excell data to vb? O y, i have project in vb, and i write data in vb, then i transfer it to excell to build chart. This is my code : ...
1
Ali Rizwan
by: Ali Rizwan | last post by:
Hi all, I m creating a database. The data for database will fetched from an excell sheet. Now how can i read an excell sheet and update my database with that excell sheet. Or I want to show...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
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,...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.