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 !
'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 !