• WSD Willett

    WSD Willett

    @wsd-willett

    Viewing 15 replies - 2,476 through 2,490 (of 2,497 total)
    Author
    Replies
    • in reply to: MDE -vs- MDB (office 97 on NT4.0) #599884

      Sorry Hadn’t noticed you are running A97

      Here’s the code behind the button;

      Private Sub YourButtonName_Click()
      Dim intButSelected As Integer, intButType As Integer
      Dim strMsgPrompt As String, strMsgTitle As String

      strMsgPrompt = “You have Selected To Close This Form, Do You Want To Continue”
      strMsgTitle = “Close Form”

      intButType = vbYesNo + vbQuestion + vbDefaultButton1
      intButSelected = MsgBox(strMsgPrompt, intButType, strMsgTitle)

      If intButSelected = vbYes Then
      Me.[YourDateFieldName] = Now()
      DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
      Me.Requery
      DoCmd.close

      Else
      ‘ NO button code…
      End If
      End Sub

      Hope this helps

      Dave

    • in reply to: MDE -vs- MDB (office 97 on NT4.0) #599749

      Not really getting involved in the archive procedure, perhaps your line of would be better located some-where before the form is closed.

      see the attached zip.

      I’ve added a button on the form which when clicked, creates a message box asking the user if he wants to close the form, if he selects YES, then your code will be run. If NO, the form stays open.

      Hope this helps.

      Check the code behind the button and change the field names to what you need.

      If this is ok, you can then disable the crosshair thru properties.

      Dave

      p.s Put the Me.requery before the DoCmd.close bit.

    • in reply to: MDE -vs- MDB (office 97 on NT4.0) #599732

      Do you have an example of the on close event event procedure or even attach a demo of the form.

    • in reply to: Report (A2000) #599410

      Thanks Charlotte, It was the format part I was looking for, I can take it from there.
      I didn’t want to use the form as the report, I think that way looks messy some-times.
      I can’t find ADO 2.5 in my references, should it be ?

      Cheers all

      Dave

    • in reply to: Report (A2000) #599351

      Here it is again fixed, it should open ok now

    • in reply to: Report (A2000) #599346

      Yes
      I’ve been having similar problems to this since upgrading to SR1

      Any body any suggestions.

      Dw

    • in reply to: Design Question (A2000) #599141

      Thanks for that,

      Dave

    • in reply to: Toggle Button (A2000) #599036

      Well.
      Cheers for that Hans, never thought it would be that easy.

      Thanks
      Dave

    • in reply to: AutoKeys Macro (A2000) #596803

      Thanks all, I can take it from here.

      Dave

    • in reply to: AutoKeys Macro (A2000) #596644

      Sorry to be a pain, one final thing.
      If I want to use lets say VbKeyF3 to do more than one task on the same form.
      Which is the correct way, Example 1 or Example 2
      (Example 1)
      Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
      On Error GoTo ERRTRAP
      Select Case KeyCode
      Case vbKeyF5
      Call Command19_Click
      KeyCode = 0
      Case vbKeyF3
      Me.sbfLabourBooking.SetFocus
      KeyCode = 0
      Case vbKeyF3
      DoCmd.GoToRecord , , acNewRec
      KeyCode = 0
      Case vbKeyF3
      Me.EstimateNo = Forms!frmlabourbooking!txtSearchEstimateNo.Value
      KeyCode = 0
      Case vbKeyF3
      Me.supp = Forms!frmlabourbooking!txtSearchSupp.Value
      KeyCode = 0
      End Select
      Exit Sub
      ERRTRAP:
      End Sub

      (Example 2)
      Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
      On Error GoTo ERRTRAP
      Select Case KeyCode
      Case vbKeyF5
      Call Command19_Click
      KeyCode = 0
      Case vbKeyF3
      Me.sbfLabourBooking.SetFocus
      DoCmd.GoToRecord , , acNewRec
      Me.EstimateNo = Forms!frmlabourbooking!txtSearchEstimateNo.Value
      Me.supp = Forms!frmlabourbooking!txtSearchSupp.Value
      KeyCode = 0
      End Select
      Exit Sub
      ERRTRAP:
      End Sub

      thanks again
      Dave

    • in reply to: AutoKeys Macro (A2000) #596633

      Thanks again Hans.

      This makes things much clearer, ( Have a lot of editing to do noe.)

      Dave

    • in reply to: AutoKeys Macro (A2000) #596617

      I notice Hans you use “select Case”, maybe I need to do the same with my code:

      Private Sub cmbClientCode_KeyDown(KeyCode As Integer, Shift As Integer)
      If KeyCode = vbKeyDown Then Me.CmbRegistration.SetFocus
      If KeyCode = vbKeyUp Then Me.cmbInsurerCode.SetFocus
      If KeyCode = vbKeyF11 Then
      If Me.cmbClientCode.ListIndex > 0 Then
      Me!cmbClientCode.ListIndex = Me!cmbClientCode.ListIndex – 1
      End If
      End If
      If KeyCode = vbKeyF12 Then
      If Me.cmbClientCode.ListIndex < Me.cmbClientCode.ListCount – 1 Then
      Me!cmbClientCode.ListIndex = Me!cmbClientCode.ListIndex + 1
      End If
      End If
      If KeyCode = vbKeyF2 Then Call cmbClientCode_DblClick(1)
      End Sub

      I use quite a few KeyCode combinations, can you steer me in the right direction here. I needed to use the VbKeyRight & Left to replace the F11 & F12 parts of the code, but when I do, I get odd happenings.
      I assume the Access default action for the keys is kicking in at the same time as I call them through code.

      Dave

    • in reply to: Ugly form (A2000) #596046

      I’ve done it.

      Set all subs to visible=false then true when the main opens.

      Now, the subs open exactly on time with the main.

      Thanks once again Hans

      Dave

    • in reply to: Ugly form (A2000) #596033

      So close. It works and helps the main to appear quicker when it is called.
      But
      When opening the menu, the main form very briefly appears and then goes to hidden.

      DoCmd.OpenForm FormName:=”frmMyForm”, WindowMode:=acHidden

      I wonder if the form can be made invisible before it loads ???

      Dave

    • in reply to: =SUM etc (A2000) #595957

      Thanks again Hans,

      I’ll give it some thought, your way seems to in the direction I need.
      Basically take the caldulation direct from the table instead of the form. Its a bit clearer now.

      dave

    Viewing 15 replies - 2,476 through 2,490 (of 2,497 total)