Search results

  1. M

    Run time error '13' Type mismatch

    Haha -I have a field named [Year]!!!! I just stuck VBA. in front of that in my code & it works :D Thankyou!!!! I'll remember that one for future too....
  2. M

    Run time error '13' Type mismatch

    Sorry, had a blonde moment & only saw the last line of your response!! :o Edited my reply now! It's still coming up with the same problem :mad: Thanks
  3. M

    Run time error '13' Type mismatch

    Yes, it is set to value list -neither with a record source for the form or without work if it isn't! I tried your code but it's coming up with exactly the same problem. The line which is coming up as type mismatch is: myYearList = myYearList & Year(DateAdd("yyyy", i * 1, Date)) & ";" or...
  4. M

    Run time error '13' Type mismatch

    Hi, I have a form & am using code to set a dropdown list: Code: Private Sub Form_Load() Dim myYearArray(2) As String, myYearList As String, i As Integer For i = 0 To 2 myYearArray(i) = CStr(Year(DateAdd("yyyy", i * 1, Date))) Next i myYearList = Join(myYearArray, ";")...
  5. M

    Which month fields to update

    I've managed to find a way around it. I'm using a link table with a column for Month then 12 Jan-Dec columns with 0 or 1 depending on which needs to be applied. The table I'm working with here isn't a table for general viewing, it's a table to hold data which will be applied to other tables...
  6. M

    Which month fields to update

    Hi, I've got a form where the user enters a system, forecast, the month it applies from & the year. This will then populate a table with the Year under a Year column header & use the month to choose which column to put the forecast in. I then want to get it to update so all the future months...
  7. M

    Add 1 new record only

    Hi, I've got a simple form showing the contents of a table with add new record disabled. There's a button to add a new record which, if the criteria are met, takes the user enables additions & takes the user to a new record. One of the fields is automatically filled. This all works fine, my...
  8. M

    Different actions for Insert and Update

    Thanks but unfortunately before update won't work for me -I need to complete all the fields in the record before my code runs as they're needed for inputs. I've managed to work out a work-around though: Private Sub Form_BeforeInsert(Cancel As Integer) Me.txtNew = "New" End Sub Private...
  9. M

    Different actions for Insert and Update

    Hiya, Yes I've realised the afterupdate event is always happening. In that event, I've tried using the newrecord property: Private Sub Form_AfterUpdate If Form.NewRecord = True Then MsgBox "New record" Else MsgBox "after update triggered" End If End Sub but it only ever gives me the after...
  10. M

    Different actions for Insert and Update

    Hi, I'm probably having a really blonde day, but I'm trying to get set a form to run one bit of code if I update a record in a table & a slightly different bit if I add a new record. I've added msgbox's to test the code & if I update a record, only the 'After Update' code runs but if I add a...
  11. M

    Docmd.RunSQL with a select query

    Hi, I'm trying to use code to open a select query when a button is clicked. I'm running access 2000 & so as the select query has several nested tables, saving a pre-written query means it won't open due to 'syntax errors' (where it keeps changing ( to [ for the nested stuff). This means I...
  12. M

    Change listbox to multiselect with code

    It appears so! Looks like I'll have to use the 2 list box hide/unhide toggle instead. I really didn't want to do that.......... Thanks for the help :)
  13. M

    Change listbox to multiselect with code

    How? This is what I can't find the right VBA code to do. It has to happen in the code or it will cause problems for other options. Thanks
  14. M

    Change listbox to multiselect with code

    Hi, I have a listbox which needs to be set to None on the multiselect option when the user comes to select from it, BUT, if they make a selection from a different listbox, there may be several items in this one which need to be selected. I think I've worked out the automatic selecting of the...
Back
Top Bottom