RE: access 2003
- From: doglover <doglover@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 22 Jul 2006 20:48:01 -0700
This is really strange sometimes the form and the text boxes synchronize ok
and other times they do not. Here is the code behind the form:
Option Compare Database 'Use database order for string comparisons
Option Explicit
Dim X As Integer
Private Sub ChooseCust_AfterUpdate()
On Error Resume Next
Me!ChooseJob = Null
Me!ChooseJob.Requery
Me.Requery
End Sub
Private Sub ChooseJob_AfterUpdate()
On Error Resume Next
Me.FilterOn = False
Me.Requery
End Sub
Private Sub cmdClose_Click()
DoCmd.Close
End Sub
Private Sub cmdInvoice_Click()
DoCmd.RunCommand acCmdSaveRecord
'Make sure they have at least one workorder selected
Dim db As Database
Dim qd As QueryDef
Dim rs As Recordset
Set db = zfGetDB()
Set qd = db.CreateQueryDef("", "SELECT wrkky_invno FROM
qryWorkOrders_uninvoiced WHERE wrkky_invno = true;")
qd![Forms!frmInvoiceSelect!ChooseCust] = Me!ChooseCust
qd![Forms!frmInvoiceSelect!ChooseJob] = Me!ChooseJob
Set rs = qd.OpenRecordset(dbOpenSnapshot)
If rs.RecordCount = 0 Then
MsgBox "You have not selected any Work Orders to invoice.", vbOKOnly,
"No Selection"
Else
DoCmd.OpenForm "frmInvoice", , , , , , Me!ChooseJob
End If
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub
Private Sub cmdPrebilling_Click()
Dim strCriteria As String
strCriteria = "jobky_cusnm = '" & Me!ChooseCust & "'" & (" AND jobid = '" +
Me!ChooseJob + "'")
DoCmd.OpenReport "rptPreBilling", acViewPreview, , strCriteria
End Sub
Private Sub cmdSelect_Click()
Dim rs As Recordset
Set rs = Me.RecordsetClone
With rs
..MoveFirst
Do Until .EOF
.Edit
!wrkky_invno = Not !wrkky_invno
.Update
.MoveNext
Loop
End With
rs.Close
Set rs = Nothing
End Sub
Private Sub Form_Close()
'Remove any wrkky_invno with a true in them before closing
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryWorkOrderDeSelect_qup"
DoCmd.SetWarnings True
End Sub
Private Sub Form_Open(Cancel As Integer)
Me.Filter = "[wrkid]=0"
Me.FilterOn = True
End Sub
Private Sub wrkid_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmWorkOrder", , , , , , "wrk" & wrkid
End Sub
I look forward to hearing from someone that can help.
Thanks,
Doglover
"doglover" wrote:
I am converting from access 97 by importing tables, queries, forms, reports,.
macro, modules and this process is complete. I am troubleshooting one form
that uses queries, code, etc to create an invoice. I am having trouble
synchronizing the form's query resource with text boxes and labels. The
following code in a label "On Click"
=zfSortLabel("tktno",[Screen].[ActiveForm]). I type the code in on the "on
Click" event and the form text boxes synchronizes fine but if I completely
close the form and reopen then the brackets around Screen have gone and the
form does not synchronize. Obviously, it will not work with out the []. Did
something change from Access 97 to Access 2003? Thanks for your help.
Doglover
- Follow-Ups:
- Re: access 2003
- From: Geoff
- Re: access 2003
- From: Geoff
- Re: access 2003
- Prev by Date: Re: mdb file format?
- Next by Date: Re: access 2003
- Previous by thread: Re: Convert Access 97 to Access 2002 or 2003
- Next by thread: Re: access 2003
- Index(es):
Relevant Pages
|