RE: access 2003



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
.



Relevant Pages

  • Re: Multi select problem
    ... that person's hobbies from the list of all possible hobbies. ... Private Sub ClearHobbySelections() ... Dim rs As DAO.Recordset ... ' Clear the user's selection. ...
    (microsoft.public.access.formscoding)
  • Re: Saving multiselect selections
    ... that person's hobbies from the list of all possible hobbies. ... Private Sub ClearHobbySelections() ... Dim rs As DAO.Recordset ... ' Clear the user's selection. ...
    (microsoft.public.access.formscoding)
  • Re: Worksheet SelectionChange Event
    ... you forgot to disable events while you're changing selection in your ... Private Sub Worksheet_SelectionChange ... Dim rArea As Range ... For Each rArea In Target.Areas ...
    (microsoft.public.excel.misc)
  • RE: form w/ listbox, select record to show the rest on the form...
    ... I changed it to a listbox. ... Now, I can make the selection, and it jumps to ... Private Sub ComboSearch_AfterUpdate ... Dim rs As Object ...
    (microsoft.public.access.forms)
  • RE: Auto populate memo fields
    ... When I currently make my selection it is populating into both ... > Dim MX1As Variant ... > Private Sub Minus() ...
    (microsoft.public.access.forms)