mrmcg
mrmcg

Reputation: 193

ACCESS 2010 SQL No data returned. SQL Returns data same query

I have the same SQL query in Access and I checked it out in SQL Server and coming up with two different results. In access I am getting 0 records sent back (Recordcount = 1) but nothing shows. In SQL I get about 30 records. Not sure what is going on.

Dim sql as String
Dim rs As Recordset
sql = "SELECT * FROM Client Where State = 'MN'"
Set rs = CurrentDb.OpenRecordset(sql, dbOpenDynaset, dbSeeChanges)
'Being called from frmClient
DoCmd.OpenForm "frmUpdate2", acNormal

The text fields on frmUpdate2 are coming up blank.
Control Source is correct and matches

Filter Lookup = Database Default
Enabled = Yes

frmUpdate2:

Record Source = Client
Recordset Type = Dynaset
Allow Additions = Yes

Upvotes: 1

Views: 80

Answers (1)

HansUp
HansUp

Reputation: 97101

There is another form property called "Data Entry" which may be involved. (Find it on the "Data" tab of the form's property sheet.)

That property doesn't mean what many people expect.

With Data Entry = Yes, the form allows you to add new records but existing records are not displayed.

Ensure the property is set as Data Entry = No if you want to both display/edit existing records and add new records.

Upvotes: 2

Related Questions