automate a auto-refresh form

Laurent
10-09-2001, 06:18 AM
i'm using 2 forms to update my database and i'm having trouble synchroning them. My sales departement send a request to the planification departement to get a delivery date, then the planification departement answers by selecting the record (in a dbgrig), loading a form with more complete info then they confirm the date and return to the first form. that first form should only contains the records with no confirmed date but the way i coded this has something wrong, when i return to the form it doesn't update before the timer is up to it's interval. here's a part of the code i'm using:

'this is my query populating the grid

SELECT client, bonCommande AS PO, reference,
modeleCylindre AS modele, qte, surface, dateDemander,
livraisonCylindre AS livraison, nosoumission
FROM confirmLivraison
WHERE modeleCylindre <> " " AND livraisoncylindre IS NULL
UNION
SELECT client, bonCommande AS PO, reference,
modeleUnite AS modele, qte, surface, dateDemander,
livraisonUnite AS livraison, nosoumission
FROM confirmLivraison
WHERE modeleUnite <> " " AND livraisonunite IS NULL;

'this is my timer function

Public Sub Timer1_Timer()
DEITI.rsreqConfirmDateFinal.Requery
DEITI.rsreqModificationDate.Requery
Unload frmConfirmDate
frmConfirmDate.Show
Timer1.Enabled = False
Timer1.Enabled = True
Timer1.Interval = 65535
End Sub


'this is my confirm button

Private Sub cmdConfirm_Click()
Dim rsConfirmDate As ADODB.Recordset
Set rsConfirmDate = New ADODB.Recordset
rsConfirmDate.Open "select * from confirmlivraison where nosoumission='" & txtSoumission.Text & "'", frmMDIMain.cnITI, adOpenDynamic, adLockOptimistic
With rsConfirmDate
If Trim(txtDateC.Text) <> "" Then !livraisoncylindre = txtDateC.Text
If Trim(txtDateU.Text) <> "" Then !livraisonunite = txtDateU.Text
If Trim(txtCommentaires.Text) <> "" Then !commentaires = txtCommentaires.Text
.Update
.Close
End With
Set rsConfirmDate = Nothing
Load frmConfirmDate
frmConfirmDate.Show
frmConfirmDate.Timer1.Interval = 1
frmConfirmDate.Timer1.Enabled = False
frmConfirmDate.Timer1.Enabled = True
Unload Me
End Sub


so all this works fine for the updates, but the grid doesn't refresh in the first timer function, but once it loaded, after the timer is up again, the refresh is done ok? can some help out on this?




I'll be amongst the best any minute now !

Volte
10-09-2001, 10:52 AM
Are you remembering to set the Interval property > 0 before the first timer function? Sorry, if I'm way off, but I don't quite understand what the problem is.

If at first, you don't succed, call it version 1.0.

Laurent
10-09-2001, 11:43 AM
ok i'm sorry i wasn't clear enough, i'll attach a pipc of my windows, the top window is my "main", the users select one line in the grid then click the button, on the click it loads the other window to allow the user to complete the information, once it's done they click the confirm button and return to the "main" window. the grid in my "main" window should only contain the incomplete records, so i did a refresh function with a timer that refreshes the grid. now my trouble is that this refresh function does not work when i call it from the other window, when i get back to the main, my old record is still there?? maybe i'm not giving enough time to the server to execute the update?


I'll be amongst the best any minute now !

Laurent
10-09-2001, 11:47 AM
sorry the attachment was to big, here it is!

I'll be amongst the best any minute now !

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum