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

Cannot Read Datasource State

Status
Not open for further replies.

guava65

Programmer
Jul 20, 2001
238
US
I'm still a novice programmer so please forgive any simpleton questions:

I'm updating a program at my office that currently uses a dBase database. I've had very few problems thus far except when I want to put an if statement on a button to post any edits or inserts to the database. I tried to use the help example almost verbatim and I always get an error message

I've tried stuff like:
If DataSource1.State = dsEdit then
...

I keep getting an error. I'm sure I'm missing something simple. Everything else so far has worked rather well.

Any help will be appreciated.

cg
 
It looks like you want to validate your input before posting, the way to do this is to write a before post handler for the table or query. S. van Els
SAvanEls@cq-link.sr
 
What I really would like to do is make sure the post doesn't take place if nothing was edited. I never though of doing this in a before post. I'll still have to verify that one of the fields was edited. Is this possible?

cg
 
If nothing is changed you do not have to worry about posting, you also can write an onvalidate handler for a particular field. S. van Els
SAvanEls@cq-link.sr
 
I put a few lines into before post and that seemed to do the trick. That was the only place that dsEdit, dsInsert was recognized.

Thanks for the help!

Mahalo,
cg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top