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!

SQL from DataEnviroment using Access 2000

Status
Not open for further replies.

HebieBug

Programmer
Joined
Jan 8, 2001
Messages
354
Location
JP
Have a little problem with the SQL statement in the dataenviroment. Microsoft says they don't advise using the SQL statement when using Access 2000 databases from within the dataenviroment. No problem then
DOes anyone know how to work with the data from an Access 2000 database from within a form.
Table Name: Newspaper
Fields: NewspaperName, State

what I would like to happen is the state that is selected from a Combobox (CmbState)
It will then update the Sources (CmbSource)
Running in the background it checks cmbstate as the criteria and then matches it with cmbsource which is the NewspaperName field.
SO far I came up with this code
DEAccessAdmin.rsSource.Open
DEAccessAdmin.rsSource.Source = "Select * FROM Newspaper WHERE State = " & Me.Cmb.state & " "
DEAccessAdmin.rsSource.Requery

Do Until DEAccessAdmin.rsSource.EOF
If Not IsNull(DEAccessAdmin.rsSource!NewspaperName) Then Me.CmbSource.AddItem DEAccessAdmin.rsSource!NewspaperName
DEAccessAdmin.rsSource.MoveNext
Loop
DEAccessAdmin.rsSource.Close

IT"S COMPLETLY WRONG but gives an idea of the dataenviroment name the command name ect...
ANyone out there any good with SQL statements?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top