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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP WITH SQL

Status
Not open for further replies.

goatsaregreat

Programmer
Mar 21, 2001
82
GB
I need to query a DB by clicking on a calendar control. The app should query the DB to find the records with the matching dates, and send that info to a grid on a separate form. I will post my sql here for your inspection. My problem is that, although the grid has the field names correct, there is no data.



Private Sub Calendar1_Click()

Dim Sql As String
Dim rs As Recordset
Dim Conn As New Connection

Conn = (DataEnvironment1.Connection2)
Conn.Open

Sql = "Select * Into datelist From Contactlist where DTC = " & Calendar1.Value & " " & _
"order by TTC"

Conn.Execute Sql

Unload Form1
Form2.Show

End Sub


TIA
 
Sql = "Select * Into datelist From Contactlist where DTC = " & Calendar1.Value & " " & _
"order by TTC"


I haven't worked with the dataenvironment, but your SQL is selecting from the Contactlist table and inserting the results into the datelist table. Does your other form read from the datelist table? You should verify that the correct values are appearing in the table, then verify that the other form is seeing the new values when they appear.

Chip H.
 
Yes, my second form reads from the correct table. The grid on the second form has all of the correct fields, but there is no data in the fields. I need to know why there is no data being transferred. I hope this is an easy fix. TIA
 
Sql = "Select * Into datelist From Contactlist where DTC = #" & Format(Calendar1.Value,"mm/dd/yyyy")& "#" & " " & _
"order by TTC"
Eric De Decker
vbg.be@vbgroup.nl

License And Copy Protection AxtiveX.

Download Demo version on my Site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top