Search results

  1. S

    Make two records that are Similar

    If you check if its blank before you start adding the record you can just exit the code: Private Sub Command78_Click() if isnull(Me.quantity) then Me.quantity.SetFocus MsgBox "Quantity Cannot be blank" Exit Sub End if Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset("Yourtable"...
  2. S

    Make two records that are Similar

    No problem, one thing to watch - if the quantity can be a null value you might want to use the Nz function or you will get an invalid use of null error. !Quantity = Nz(Me!Text64) * -1
  3. S

    Make two records that are Similar

    If you are using an unbound form then the code you have isn't far away. Private Sub Command78_Click() Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset("Yourtable", dbOpenDynaset) With rs .AddNew !Employee = Me!Combo68 !Material = Me!Combo48 !Length = Me!Combo29 !Caliber = Me!Combo31...
  4. S

    Dont let form close if date not filled in

    The unload event should fire if the user try's to close the form using any of those methods. I often use a pop up form to update a single record. i.e. if there isn't enough room to show all fields on a sub-form.
  5. S

    Comparing two tables

    Bhoc: no problem, if you edit the query in design view you will be able to add in the fields you need from players to set the criteria. I should have said I totally agree with jdraw around the database design and normalisation. However I have been in a situation like this myself before where...
  6. S

    Comparing two tables

    No one in your 'Players' table have both set to true. To see who is listed anbd who isn't you need to do a union query from your 'foursomes' table and join it to your 'players' table. SELECT Players.Fullname, Q_Union.PlayerNo FROM Players LEFT JOIN (select Player1 as player, "p1" as PlayerNo...
  7. S

    How to use command button to select image and show it in an access form one after one

    You are not storing the image in a table - therefor for every image that is entered it just overwrites the previous... Can there be multiple remarks per image or will there only ever be one? If there can be multiple you need to have a second table for the images with a primary key that can...
  8. S

    Dont let form close if date not filled in

    By the time the form close event fires you are too late to stop it from closing. Try putting your code into the unload event.... Private Sub Form_Unload(Cancel As Integer) If Me.Case_Status = "response received" And IsNull(Me.response_received__date_) Then...
  9. S

    If specific values then...

    This could be done just by adding in another and statement: ElseIf Me.txte_date_due.Value & "" = "" And Me.cmbStatus <> "11" And Me.cmbStatus <> "12" Then Me.txte_date_due.SetFocus MsgBox "'Date due' is a mandatory field", vbOKOnly, "required field" Exit Sub If it is likely that...
  10. S

    Code Help Please

    Environ("Workername") will only work if you if a windows environment variable set for that. if not it will return a null value. If you are trying to get the users login name using environ it is usually Envrion("Username").
  11. S

    Excel spreadsheet on a tab in a form

    Have you linked the subform to the master form? I cant post a link to the office site (as I haven't got enough posts) but there is a detailed guide on adding a subform there here is the url...
  12. S

    Excel spreadsheet on a tab in a form

    That isn't a spreadsheet - it is a subform set to datasheet view.
  13. S

    Changing Environ field automatically in report.

    If you haven't got a solution for this already... one way is to create a function and call that in the report: Function: Public Function Uname() Uname = Environ("Username") End Function set the control source of your textbox to: =uname()
  14. S

    passing a variable to a query

    You are passing the text 'bin_nr' instead of the variable - you need to add this outside of the quotation marks... Ifthe field [BIN] within your database is a text field: SQL = "SELECT [BIN],[Analyst] FROM tbl_case_list WHERE [BIN] = '" & BIN_nr & "'" However if it is stored as a number then...
  15. S

    Unbound TextBox Character Limit

    The .text property has a size limit of 2048 characters try changing it to .value: Me.LogList1.value = Me.LogList1.value & vbCrLf & tdf.Name & "|" & intRecCount
  16. S

    Optional (multiple) calendar criteria

    Hi Ziggy, not sure if I have your question correct - are you wanting the query to return records between 2 dates on a form or if there is no value in the text boxes return all records? Between [Forms]![frmReport]![TxtFrom] And [Forms]![frmReport]![TxtTo] Or ("OR" Between...
  17. S

    DSum with multiple and optional criteria

    I would recommend that you have your form bound to a totals query. Sum the fields you want totals for in the query and the fields that have possible criteria use the where clause, within the criteria for each of these fields reference back to the form like this : '...
Back
Top Bottom