Search results

  1. T

    [Type your Name Here]

    You can also use the format property of the textbox on a form to display the text then have it disappear when the box gets focus. In the format property use: @;"Type Your Name Here"
  2. T

    display a lookup in textbox on form

    You need to reference a field on your form for the ID to match =DLookUp("FirstName","dbo_EmpBasic","PCL_Employee =" & [YourEmpIDFieldName])
  3. T

    display a lookup in textbox on form

    Like all things in Access there are multiple ways to "skin a cat". You can change the control to a combobox and change the columns to hide the ID and show the name. You can use DLookup to get the name based on the ID. You can change your forms recordsource query to join the tables and get the...
  4. T

    How would the Pro's do this?

    Yes it will because it is being opened with the acDialog command. This means the loop will not continue until he closes the first form.
  5. T

    How would the Pro's do this?

    Where are you putting this code? The Form_Current of which form? Your popup? If so, that is why there is an error. This should be on the Form_Current of your tool list.
  6. T

    How would the Pro's do this?

    This works for me in your stripped database: Dim rcrdst As DAO.Recordset Dim varTN As Variant varTN = InputBox("Enter a Tool Number or Part Number.") Set rcrdst = CurrentDb.OpenRecordset("SELECT * FROM ToolingNotes WHERE TN_ToolNumber = '" & varTN & "' AND TN_Critical = TRUE", dbOpenDynaset...
  7. T

    How would the Pro's do this?

    I also notice you make a reference to TN_ToolNumber, but this is not a field in your table. It looks like you need [Tool Number]. Be sure to use the brackets since your field name has a space in it.
  8. T

    How would the Pro's do this?

    Since your ToolNumber is text you need single quotes around it. Like so: Private Sub Form_Current() Dim db As DAO.Database Dim rs As DAO.Recordset Dim varTN As Variant varTN = InputBox("Enter a Tool Number or Part Number.") Set rs = CurrentDb.OpenRecordset("SELECT * FROM ToolingNotes WHERE...
  9. T

    How would the Pro's do this?

    This code will not open multiple instances as called by the acDialog option.
  10. T

    How would the Pro's do this?

    What is the compile error?
  11. T

    How would the Pro's do this?

    A recordset is just that, a set of records. You specify what records with the SELECT statement just like a form. The recordset lives in memory while the code is running. CurrentDB is just a reference to the connection. So the code is saying in the database that I'm in, open a set of records...
  12. T

    How would the Pro's do this?

    The way I would go about this would probably be something like this: Bind the popup form to the notes table and the textbox to the message. Then this code would go in the OnCurrent event of your tooling page: Dim rs As Recordset Set rs = CurrentDb.OpenRecordset("SELECT * FROM tblNotes WHERE...
  13. T

    Check input by scanner

    This would probably be best in the after update of your textbox since most scanners move fields after they scan. Then you would simply check for the string and if it doesn't start with "EN" then set the field to "" and set focus.
  14. T

    record date a record is modified

    You don't have to break out the date in delimiters. Date() is a function that does not require being broken out. So from the original string all that is necessary is to put quotes around the SQL string. Docmd.RunSQL "UPDATE tblInstruments SET tblInstruments.ModDate = Date();"
  15. T

    How to check if a subform is empty?

    You said subREPORT... is it a subreport or a subform? Big difference.
  16. T

    How to check if a subform is empty?

    You can load a copy of the subform's recordset into memory then check if it's empty. Dim rs as RecordSet Set rs = me.subfrmHazardRAMS.Form.RecordsetClone If rs.BOF and rs.EOF Then MsgBox "No Records" End If
  17. T

    If Statement for numbers

    This function will return true if any of the characters are numeric: Public Function HasNumbers(strInput As String) As Boolean Dim i As Integer For i = 1 To Len(strInput) If IsNumeric(Mid(strInput, i, 1)) Then HasNumbers = True Exit For End If Next i End Function
  18. T

    Joining 4 tables and multiple relationships

    You're going to throw an error with that SQL. Lose the tblA in red and possibly the parenthesis around tblD join.
  19. T

    Add hours to a given date and time

    Did you even try the function before replying? The result of your example is exactly what you are looking for.
  20. T

    Add hours to a given date and time

    The following would lookup holidays, but be warned the DLookup will slow the function down Public Function AddHours(datStartDate As Date, intHours As Integer) As Date Const intDayStart = 8 Const intDayEnd = 17 Do While intHours > 0 datStartDate = DateAdd("h", 1, datStartDate) If...
Top Bottom