Search results

  1. R

    How to add new record by using vba or sql once click a button?

    Hi Do you want to include data in the new record (as part of the Click event), or just add an empty record? You can use DoCmd.GoToRecord (see Access Help for syntax), or you can use DoCmd.Execute with SQL (using INSERT statement with data). You can also use a Recordset with rst.AddNew ...
  2. R

    Question How To Refresh The SubForm?

    Hi I have made an example DB with some of your data to show how you can simplify and consolidate the structure. I have created four tables: tPublication, tTitle, tAuthor and tRole. The purpose of tPublication is to link the other tables together to allow a single title for a publication, but...
  3. R

    Question How To Refresh The SubForm?

    Hi I'll have a look in more detail when I get time - later today or tomorrow. In the meantime, can you describe what the DB is aiming to achieve in business terms, please? I can see publication details in the tables, but how are these to be used? When searching, what types of item should be...
  4. R

    Question How To Refresh The SubForm?

    Hi I have had a look at your DB, but I can't relate the tables to your question. I assume the Main from is 'MForm' and the SubForm is 'Results'. There is no linkage between parent and child forms in the SubForm control ('Link Master Fields' and 'Link Child Fields'), which would explain why your...
  5. R

    Question How To Refresh The SubForm?

    Hi In your main form, you can use Me.SubForm.Requery (where 'SubForm' is the name of the Subform control in your form). HTH
  6. R

    Saving a combobox after a form is closed and re-opened

    Hi How many users do you have using the same DB? I infer that you want to keep the filter criteria for each user on an individual basis? Have you considered using a table to save the filter criteria, then restore the user's setting when the form is next opened (in the Form_Open event)? This...
  7. R

    Message box to display "No results found"

    Hi With the counter and message box, your code would look like this:Private Sub Find_Click() On Error GoTo Find_Click_Err Dim intCount As Integer intCount = 0 If DCount("Heading", "Service Desk Manual Query") > 0 Then intCount = intCount + 1 DoCmd.OpenQuery "Service Desk Manual Query"...
  8. R

    Message box to display "No results found"

    Hi How does the TextBox relate to your Click handler? Is it relevant to the problem? I assume you want every query to open when its test condition is true? I ask because you could use ElseIf on each DCount test to select the first which is true, with a final Else with the MsgBox is it gets...
  9. R

    Application-defined or object-defined error - Cant figure it out! Help

    Hi You refer to 'pop-up form' and 'Subform' in your opening paragraph - I assume these are referring to the same thing? I'm wondering whether your pop-up is calling its caller and thus causing a 'deadly embrace' (the caller can't proceed until the pop-up closes). I don't know whether or not this...
  10. R

    Before Update vs. Form Close

    IMHO there is always another way to do things in code :D From a quick scan, it appears that your code block is trying to handle multiple forms without reference to the correct context. Am I correct in thinking you have several forms open and you have this code replicated in each? I see 'fType'...
  11. R

    Before Update vs. Form Close

    Hi You could try checking the Form.Dirty property when closing the DB. I'm not sure where to put this from your description, but the process steps would be: In the Application Close procedure, set a flag e.g. 'flgClosing'. In your other events, test the setting of the flag and the form's Dirty...
  12. R

    Making capital each word in field

    Hi The code you posted shows the Exit event for a specific field, but your question suggests you do the same thing for multiple fields? The simplest way to achieve the conversion is to put the code in the subform's field event handlers in the same way as the parent form. You could also iterate...
Back
Top Bottom