Search results

  1. M

    Find & replace in VBA

    Hiya, Unfortunately I can't seem to find examples of how the find & replace works in VBA so please can someone help me finish my bit of code! Situation: A number of tables are imported with the My_Field column having items such TSM_usualtext_blah Blah could be anything. All the other...
  2. M

    GotFocus event not running

    Hi, I'm trying to run a 'GotFocus' event on one of the text boxes on my form. Here's the code in progress: Private Sub txtCINAME_GotFocus() MsgBox "got focus" End Sub When I click on the text box, it's not running at all!!!!!!!! I've tried adding a GotFocus event to other text...
  3. M

    Undo selection change to combo box

    Hi, This is difficult to post code for as it's involving lots of different calls & events so I'll try & explain: I have a form which has a combo box (source field: [SName]) to filter it. Users can then make changes. The combo box has an AfterUpdate event for: strComboSelection=me.combobox...
  4. M

    Runtime error 3190 too many fields defined

    Hiya, I'm trying to export some data to excel. I have a 'subquery' which is joining 2 tables with about 6/7 fields each then 'union all' to a different 2 joined tables with about 6/7 fields each as well. This 'subquery' is then used in a crosstab query which is joined with 1 other table...
  5. M

    Delete query using non-linked table

    Hi, I really am having a bad day today. I'm having problems with htis delete query too: DELETE DISTINCTROW tbl_Actuals_FC.* FROM tbl_Actuals_FC, tbl_Actuals_Date WHERE Mth >=ActDate; Mth is a date field in tbl_Actuals_FC, format dd/mm/yyyy ActDate ditto for tbl_Actuals_Date but this...
  6. M

    Updating sum of a field

    Hi, I'm about to burst into tears & throw my laptop out the window. I have a form which shows data from a table. There is a sum cell on the form: Sum([CPU New]) (CPU New being a field in the source table) After I change the value of one of these numbers in the form, if I then immediately...
  7. M

    Question Export to named range in excel with named ranges within the data

    Hiya, I'm having a bit of fun getting my exports to work!! I'm exporting a few queries to populate up a nice pretty excel report. From the excel perspective, there's the 'Data' range, a couple of 'Lookup' tables & the control date (month the report is for) I've got the Data section...
  8. M

    Crosstab query as source for form & filtering/editing

    Hi, I know there's a lot of question around on this, but I'm really struggling to understand what's going wrong. This is my code: PARAMETERS forms!frm_Sys_TCID_FC!txtSys Long, forms!frm_Sys_TCID_FC!cmbyr Long, forms!frm_Sys_TCID_FC!cmbtcid Long; TRANSFORM...
  9. M

    Set the background colour on a report

    Hiya, I'm probably being completely blonde here, but I can't sem to work out how to change the background colour of a report. I've set the header, detail & footer background colours, but when it's in print preview, it comes up with big white borders that look really messy. Also, if there's...
  10. M

    FilterOn not working

    Hi, I've got this code on a combo box Private Sub cmbSysName_Change() Dim strFilter As String If IsNull(Me!cmbSysName) Then Else strFilter = "'" & Me!cmbSysName & "'" Form.Filter = strFilter Form.FilterOn = True End If End Sub It's running but...
  11. M

    Unbound Combo box

    Hi, I have 2 combo boxes -1 in the header & 1 in the detail. Both have lists attached to them & are limited to the lists. In the header, if I start typing in it, it predicts the selection from the list. In the detail it doesn't -in fact it doesn't even show what I typed although it does...
  12. M

    Tick box value

    Hi, I've got a table with a key & a 'Live' tick box. I just added a new item to it via a form -enter the key & the default for the tick box is 'Yes' according to the table setup. It's then supposed to pop up in a combo box on a form but wasn't so I created a query to have a look & cannot...
  13. M

    Prevent users from seeing design view of a form (re-enable)

    Ummmmm, having disabled everything on startup, how do you go back & re-enable it!!!!!!? Thanks......
  14. M

    External Table not in expected Format

    Hi, I'm setting up some vba to import a series of tables. They're saved as excel 97-2003 files but are a bit weird. When I open them in excel, they say it's in a 'different format than that specified by the file extension' & so when access runs the vba, I get the 'external table not in...
  15. M

    Error in importing .txt files

    Hi, I've set up my vba to import some .txt files on the click of a button. That's all fine, except, while importing I get the message: Microsoft Access was not able to import all the data etc etc The contents of fields in x records was deleted etc When I look at these tables in excel, I...
  16. M

    RecordCount error

    I'm running the below code: Dim db As Database Dim rst As Recordset Dim Counter As Integer Set db = CurrentDb Set rst = db.OpenRecordset("SELECT [Field] FROM tbl_Imports WHERE [Use] Is Not Null", dbOpenDynaset) Counter = rst.RecordCount MsgBox Counter & the MsgBox is coming...
  17. M

    On error option -resume or end

    Hi, I'm running a vba loop to import a list of tables. Assuming the end user has had a blonde moment & forgotten to untick one of the tables in the appropriate form & so the loop comes to a table which isn't there & so an error. In some circumstances, it may need to be there, & so stopping...
  18. M

    Custom date format for custom combo box value list

    Hi, I've written some vba to set a combo box value list as last month or the month before. Now I'm trying to format it & am having issues. I've set the combo box itself to be mmm yyyy & once a selection is made, it displays like that, but the dropdown is still showing eg 01/02/2011. What do...
  19. 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, ";")...
  20. 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...
Back
Top Bottom