Search results

  1. Mile-O

    if user selects wrong value, display message

    Well, it won't show a message to the user, but it will restrict their choice to the options in the combobox. If you want to do a message, then these lines: Private Sub YourComboBox_NotInList((NewData As String, Response As Integer) MsgBox "The selection is wrong.", vbExclamation +...
  2. Mile-O

    if user selects wrong value, display message

    As above, then.
  3. Mile-O

    if user selects wrong value, display message

    Is this combo in a table field or on a form? If a form, then you can set the combobox's LimitToList property to Yes and, in the OnNotInList event, the following: Response = acDataErrContinue
  4. Mile-O

    Searching Access

    First things first: are you replicating these spreadsheets like for like in an Access table, or have you taken the necessary steps to design/normalise your data into a set of tables in Access?
  5. Mile-O

    Run queries that are named in a table.

    Or even: DoCmd.OpenQuery "QueryName"
  6. Mile-O

    not enough stock msg

    Perhaps evaluate the user input in your control's BeforeUpdate property. i.e. Private Sub YourTextBox_BeforeUpdate(Cancel As Integer) If Me.YourTextBox > Me.TheQuantity Then MsgBox "That's too much stock for the quantity", vbExclamation + vbOkOnly, "Too Much Stock" Cancel...
  7. Mile-O

    Run queries that are named in a table.

    If you're getting the Too Few Parameters error then it's likely you're going to have to look into the QueryDef object and its Parameters collection, as it sounds like the queries you are trying to open need their parameters defined.
  8. Mile-O

    WithEvents & Form Class For All Forms

    Answering my own questions now. Basically, here's my new AppForm class. Option Compare Database Option Explicit Private WithEvents frm As Access.Form Public Sub SetAttributes(ByRef param_frm As Form) Set frm = param_frm With frm ' some general form attributes...
  9. Mile-O

    WithEvents & Form Class For All Forms

    Okay, I'm sick of designing forms whereby I have to go through their individual settings and set things like PopUp to True or RecordSelectors to False. Therefore I want to create a form class that, in the Form_Open event will do all that form me for every form. So, I've got a class called...
  10. Mile-O

    Cleaning up the name field

    Bit messy, as just cobbled it together, but this may help. Personally, I think it would be better if the forename and surname were stored in separate fields.
  11. Mile-O

    Cleaning up the name field

    As I said, an UPDATE query. Change value to Felix Hernandez. Set criteria as the field in question = HERNANDEZ JR, FELIX / BRADY, ANDEL
  12. Mile-O

    Cleaning up the name field

    Is it only this one name you need to clean up? If so, you could just use an UPDATE query.
  13. Mile-O

    SQL Error?

    Dim rs As DAO.Recordset Dim myVar As WhateverTypeItShouldBe Set rs = CurrentDb.OpenRecordset("YourQuery") myvar = rs.Fields(Whatever Field Number It Is) rs.Close Set rs = Nothing
  14. Mile-O

    SQL Error?

    Your SQL can't be found because the OpenQuery method is looking for a query. It doesn't recognise your SQL as the name of a query in your database. Time to look into the QueryDef object.
  15. Mile-O

    SQL Error?

    For info, the SQL you built was a SELECT query. All it does is select some records. The command you used was DoCmd.RunSQL. This supposes the query will perform an action. Actions include UPDATE, INSERT, DELETE. They do not include SELECT.
  16. Mile-O

    Access 2000 Tables imported into Access 2007

    Is it in a folder that isn't yet trusted by your Access install?
  17. Mile-O

    Date Problems dd/mm/yyyy - mm/dd/yyyy

    If you change the format to: dd-mmm-yyyy what results are you getting?
  18. Mile-O

    Unexpected Data Retrival in Form

    Use queries for your forms and controls; never tables.
  19. Mile-O

    Question about VBA Code

    Before the WHERE you have a random bracket. Take it out.
  20. Mile-O

    function for dayvof the week

    Set the Format property of your textbox to: ddd. mm/dd/yyyy
Back
Top Bottom