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

Data Update Problem

Status
Not open for further replies.

bmj

Programmer
Aug 2, 2000
6
0
0
US
I am using code to enter data into fields that are linked to an existing record in a database. The problem is that the record is not being updated ( at least I can't see that it is) until I exit out of the program and then go back into it. How can I update the record without exiting??

I have tried adoCallInfo.Update("Field") but it does not work.
 
Could you post the code on the board so we could go through it?

Delton Phillips.
deltonphillips@hotmail.com
 
I am not sure about this for your code, but you could try the following after you do the update:

DBEngine.Idle dbRefreshCache

I believe it forces the access jet to write any changes to the database.

This may or may not help, give it a try and advise the forums. Very little experience in programming
But I do know VB5, InstallShield Express 2.1X
and Access 97.
 
Here is part of the code from the OK Button on my "Clear Call" dialog box. The subs that I am calling are just performing routine math functions. I am no sure if I am using the Update correct. I keep getting errors if I try to specify a field.


dlgClearCall.Hide
Call LogSheet
frmDispatchEntry.adoCallInfo.Recordset.Update
Call TotalCostDetail
Call TaxRate

DBEngine.Idle dbRefreshCache

'Find All Calls
Value = frmDispatchEntry.grdDispatchedCalls.Columns("Call No").Text
Dim strQuery As String
strQuery = &quot;Select * From CallInfo Where CallNo <=&quot; &amp; Value

With frmDispatchEntry.adoCallInfo
.RecordSource = strQuery
.Refresh
End With

With frmDispatchEntry.grdDispatch
.ClearFields
.ReBind
End With
frmDispatchEntry.adoCallInfo.Recordset.MoveLast
 
I had the same problem, I think. I opened a global recordset, and had a form that would add records to it. When I needed to access the added records through the global recordset, they would not be there.

I opened the global recordset with the Dynamic cursor type. Then cleared any filters (adorecset.filter=&quot;&quot;) and requery the recordset(adorecset.requery) after the new data is entered on the other form.

This worked for me, I hope it helps you.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top