Search results

  1. C

    Solved Alter a table by adding a column

    After checking an imported table, if a column is missing, I need to add it to the temporary table before it can be imported to the main table. The ID (not the autonumber main ID but a second one) is built using a recordset but if the column is missing it breaks. Occasionally a user will omit it...
  2. C

    Combo information

    I have a subform that has a combo box with 5 columns of information to assist in picking the right record for one field. This information is drawn from a different query from the subform query. I'd like for this (5 fields) information to remain in smaller un-enabled fields underneath the actual...
  3. C

    Solved Combo in Contacts

    I would like to combine phones into one combo box. I have business, mobile, home, fax, email fields. They take up a lot of room on a datasheet and many of them are empty. I thought I could combine them into one combo box but it's not coming out like I visualized. I though a union query would...
  4. C

    Solved Add date when particular field updated

    I have a form that shows the date a record was created. Before updating I have a date field for when a record was modified. Now I'd like to automatically add the date when a rep takes over a client. This would be when a rep ID is added to the record from a combo box. I don't want this date to...
  5. C

    Solved Print preview does not match printed page

    I have a report with the page number as openargs if it isn't the complete report. Print preview has the correct page numbers but when I print the preview, it starts with page 1. Obviously, the preview is not what's printing. How do I fix this?
  6. C

    Solved VBA SQL string with DCount

    Honestly, I've tried and tried... put quotes all over the place and this doesn't work strWhere = "DCount("*","tblSales","[tblSales].[ContactsID] = 'Me![contactsID]'")>" & 0
  7. C

    Solved Grouped records are uneditable

    I have contacts that are joined to sales. If there is more than one sale, then I get multiple records for each contact. I use a query that asks for the MIN(SalesID) but then because of this grouping the contacts are not editable. How can I fix this? Or what's a better way to ask my question to...
  8. C

    Solved Replace WHERE with AND

    I have a form that uses one filter and a subform on that form that uses another. I have an intermediate dialog that pulls the Source from the form and the filter from the subform. I want those selected records copied to another table. When I try to create a SQL with both filters I end up with...
  9. C

    Solved Recordsource does not exist

    I have a list form of contacts, some with sales and some without. I'd like to be able to limit this form by option: ALL; With Sales; Without Sales. I do not want the recordset query to have the sales info on it because it limits editability. So... I probably took a simple problem and made it...
  10. C

    Solved VBA adds spaces in SQL

    sql = "SELECT qryRecipe.recipeID, t_recipeingredient.ingredienttext AS Ingredient, " _ & "qryRecipe.recipename, qryRecipe.t_cookbook.name AS cookbook, " _ & "qryRecipe.t_cookbookchapter.name AS chapter, qryRecipe.createdate, " _ & "qryRecipe.source, qryRecipe.author " _...
  11. C

    Solved Adding field values in VBA

    Do While intLane < Me.[StartLane] + Me.[NoOfLanes] + 1 StartLane = 41 NoOfLanes = 3 Wanted answer = 44 Returned answer = 414 How do I return field values instead of text?
  12. C

    Solved Treeview

    Private Sub tvCookbooks_NodeClick(ByVal Node As Object) On Error GoTo ErrorHandler Dim dbs As DAO.Database Dim rs As Recordset Dim KeyPart As Integer Set dbs = CurrentDb Set rs = Me.RecordsetClone KeyPart = Val(Right(Node.key, Len(Node.key) - 1))...
  13. C

    Solved Function as Boolean

    I think I don't understand Boolean functions. You helped me here last night so here I am again. My function does what it's supposed to do but it doesn't return anything. It creates a query -- qryOut filled with a recordset. Then I want to export it. I need the boolean part to error out when...
  14. C

    Solved Record source vs filter source

    I have a button that pops up a form for exporting records. The open event is: txtSource = Screen.ActiveForm.RecordSource If Screen.ActiveForm.FilterOn Then txtFilter = Screen.ActiveForm.Filter End If From this I do a little cleanup and create a Sql statement. My problem is this Sql returns...
  15. C

    Solved Select case error

    I've messed and messed with this. When I debug, the intChapter is 0 but it still jumps to the 2nd case and then throws an error that the element isn't found. It isn't found because the node belongs on a book (case 1) and not a chapter (case 2). I know you always find my logic errors... What am I...
  16. C

    Solved TransferText

    I have a popup window that takes a recordset from the form and does optional things with it. The following gives me a Data Type conversion error Is it ok to pull out specific fields from an already existing recordset to export? Or is there a better way? Dim strSql As String Dim...
  17. C

    Solved filter adds Lookup_field. to field

    I use the same query for the form and the report. There are several combobox fields. When the form is filtered, the filter statement adds Lookup_field to field when the field is a combo and then the report doesn't recognize it and throws a parameter message. (((qryField.PlantDate=#3/1/2015#)))...
  18. C

    Solved passing filtered recordsets to reports

    On my main form I have filtered 9 records In the General Declarations area I have Option Compare Database Option Explicit Public rst9 As DAO.Recordset Private Sub cmdReport_Click() Set rst9 = Me.Recordset 'Debug.Print rst9.RecordCount returns 9 records DoCmd.OpenForm "popPrint"...
  19. C

    SQL statement doesn't pick up variable

    Dim intDistance As Integer strSQL = "SELECT t_recipe.recipeid," & _ " t_recipe.recipename," & _ " t_cookbookchapterassociation.cookbookchapterid," & _ " t_cookbookchapterassociation.distance" & _ " FROM t_recipe INNER JOIN...
  20. C

    Solved Combining fields with query

    I know how to concatenate fields and I know how to UNION fields but I'm stumped on a problem here that sounds so simple: I would like to combine one field with multiple foreign keys. For instance a child has two parents with the same child ID. How do I get these two parents together into one...
Top Bottom