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

form with date select (new user)

Status
Not open for further replies.

QBrain

Programmer
May 14, 2003
1
US
OK, I am building my first ADP today. I need a simple way to select a date from an editbox, press a button that retrieves that date and returns an editable recordset based on that date. Now I'm an expert wit SQL (I'm using SQL server 2000 for the data storage) and C++, but my goal is to use access for quick database edits.


Being a newby to access, I don't know where to start. I can easily return all the rows of my table, but I need only the ones I've selected, and only after I click my button. Any help will be appriciated
 
Do you want to bind that table to your form or just have the data in a new table.

if you want to run an sql try

docmd.runsql "select * from table"

this actually does not work but any other query (insert, update) that does not return any records will work

if you want to work with your records then try something like this

dim con as new adodb.connection
dim rst as new adodb.recordset

set con = currentproject.connection
set rst.activeconnection = con

rst.open "SELECT * from table"
txtbox = rst.fields("fieldname")
rst.close

if you want a form to be bound to a query then try this

formname.recordsource = "SELECT * FROM table WHere date = '" & txtdate & "'"




Christiaan Baes
Belgium
"What a wonderfull world" - Louis armstrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top