I'm just doing a little app for myself, just on my own PC. I have made a DB (originally using the DAO library - it's a pretty small DB, and doesn't need fancy bells and whistles). Once the DB was created, I deleted the code that created it; after all the DB is now there!
OK, the problem.
I have a simple data control hooked up to the DB (told you the app was simple!) and there is only one table "charts" with two fields "starname" and "chart". Guess what... it's a database of star charts. Both fields are strings. First one is obvious, second field is a serial number identifying the chart (say something like 'abc1234'). The type is access, dynaset.
As a test I have made one record. starname
= ss cyg and chart
When I leave the star name text box (after having entered the star name) and the next box gets the focus, this code fires inside its GotFocus event:
Dim thestar As String
thestar = txtStarname.Text
Data1.RecordSource = "select * FROM charts WHERE [Starname]= 'thestar' "
Also on the form is a bound text box hooked up to the 'chart' field of the DB.
I enter ss cyg
in the starname text box and yay! 1978
appears in the 'chart' text box. Unfortunately if I enter anything else in the starname text box, 1978 still appears in the 'chart' text box! Why? Any ideas?