Search results

  1. M

    How to execute SQL in automation

    Hello, It's depending where is your SQL code. You can execute a query with : Docmd.RunCommand strSQL or with the name of the database with Dim db as DataBase Set db = yourdb db.Execute strSQL Good continuation
  2. M

    If you forget any field is empty , MsgBox alerts the forgotten field

    Hello, Like this : If IsNull(Me.[TestName]) or Me.TestName = "" then MsgBox ("There is no data in TexteName") Me.TestName.SetFocus Exit Sub If IsNull(Me.[FromDate]) or Me.FromDate= "" or Not IsDate(Me.FromDate) then MsgBox ("There is no data in FromDate or a value is not a...
  3. M

    Problem With Form Buttons

    Hello, Look at helps of the Docmd.OpenForm's method ! Your code must be like : Docmd.OpenForm acForm, "Devices Details",, , "[Device / Computer Name]=" & "'" & [Patched From] & "'", Have a good continuation
  4. M

    Duplicate field allowed only with checkbox = true

    Hello, Sorry a little mistake before NoMatch, I forgot a "." Private Sub BandNum_AfterUpdate() With Me .RecordsetClone.FindFirst "[BandNum]=" & Me.NewBandNum If Not .NoMatch Then 'Verify if Recapture is False If Not Me.Recapture Then MsgBox "Please select...
  5. M

    Duplicate field allowed only with checkbox = true

    Hello, A code like this at the AfterUpDate event of the textbox ?: With Me .RecordsetClone.FindFirst "[IdNumber]=" & Me.NewIdNumber If Not NoMatch Then 'Verify if ChkBox is False If Not Me.ChkBox Then MsgBox "Please select the checkbox duplicate first to add...
  6. M

    Macro to close report & clse the form

    Hello, Why don't you use the AcViewNormal argument in place of AcViewPreview and then Close your form VendorPayables_Maintenance_F in this procedure. I add a button for this in your form. If a preview of the report is necessary, you can add an action Docmd.close acForm...
  7. M

    To Clear the Fields in form and from the table with a button

    Hello, Clear or Delete the record, With a bound Form, I think you want to Delete, so you can use : Docmd.RunCommand acCmdDeleteRecord Have a good continuation
  8. M

    DCount with And Syntax

    Hello, And like : Me.lblpaid.Visible = (DCount("*", "tblHour", "[Hours]=Null") > 0 And [Paid] = "No")
  9. M

    DCount help please

    Hi, And with : DCount("*","Attendance","[Absent]= True And [Date] Between #" & _ Format([Forms]![DateSelect]![txtStartDate], "mm/dd/yyyy") & "# And #" & _ Format([Forms]![DateSelect]![txtEndDate], "mm/dd/yyyy") & "#") You got the good result?
  10. M

    Transferring data from one form to another

    Hi, I suggest you to use this code which is simpliest if you have to add only the name of company in the table to actualise the combo. You have not to open another form "frmCompany" with this code. Private Sub cmbCompany_NotInList(NewData As String, Response As Integer) Dim db As...
  11. M

    Transferring data from one form to another

    Hello, Use Requery method before assign value to your combo "cmbCompany : Public RemCompany As String Private Sub cmdCloseCompany_Click() ‘‘FIRST PORTION - Add new company into table Dim dbCom As Database Dim recCom As Recordset Set dbCom = CurrentDb Set recCom =...
  12. M

    Subform problem: Inputbox reappears when closing DB

    Hello, When you close your form, it searches the parameter for its RecordSource. I suggest you to put back the query "qry_tracking" as RecordSource of your form when you close it. Good continuation
  13. M

    Updating sort order of records

    Hello, "simple way", No. The value depends of the "StepOrder" field, so to give an appropriate solution, how do you define the value of "StepOrder" ?
  14. M

    Help with SQL statement in VBA

    Hello, And like this : DoCmd.RunSQL "INSERT INTO tbl_Records ( RecordDistinction, RecordDateMONTH, RecordDateYEAR, " _ & Revision, RecordNumber, RecordName )" & _ "SELECT" & [Forms]![frm_NEWDateDist]![cmb_RecordDist] _ & "," [Forms]![frm_NEWDateDist]![txt_NewMo] _ & ","...
  15. M

    Delete record from Subform and Table

    Hello, May be easier : Private Sub Command58_Click() 'check existing selected record If Not (Me.PayrollsearchQuery.Form.Recordset.EOF And Me.PayrollsearchQuery.Form.Recordset.BOF) Then 'confirm delete If MsgBox("Are you sure you want to delete", vbYesNo) = vbYes Then 'delete now...
  16. M

    Unknown Error Popup

    Hello, I think the criteria used in the dlookUp is not correct : DLookUp(" [SMax] ","MMaxValue","[FY] + 1 ") What do you mean with "[FY] + 1 "
  17. M

    is there an autosave anywhere in access

    Look at if you have a line "Docmd.SetWarnings False" somewhere in your code without the reverse "Docmd.SetWarnings True" after.
  18. M

    textbox value based on two other textboxs

    Yes, you have an UpDate event in your subform where you can put the code.
  19. M

    is there an autosave anywhere in access

    It's surprising. Ms Access is the same. Try to set on warnings lauching a module : Public Sub BackWarnings() Docmd.SetWarnings True msgbox "Warnings set ON !" End Sub
  20. M

    what does the AfterUpdate event do

    May be you have code on the Open or OnLoad events of the second form as you use the OpenArgs argument ?
Back
Top Bottom