Search results

  1. H

    Column Name based on value in another table

    I've searched around a bit but I can't find an answer. Is it possible to name a column in a table based on a value in another table?
  2. H

    update the id number so there is no duplicates

    I have a table that has duplicate numbers in the ID column and I want to get rid of them. When I first populate the table I need to have duplicate numbers since I run some code that breaks part of the records into two. After I'm done with that I need to change the ID field so they are all...
  3. H

    Delete records based on criteria

    I'm trying to clean some records that have part numbers, category number, service type, and etc. I trying to write some vba that will delete a record based on two or more rows . The example below is scaled down. For every duplicate part number I want to delete the record if category1 and...
  4. H

    Password error handling

    I have a password protecting a form when it opens. That part works, the problem is I get a error if the user hits the cancel button or the wrong password is given. I get a run-time error '2501': The OpenForm action was canceled. The msgbox is opening before the error message opens. The...
  5. H

    Query won't sort based on form combo box

    I have a query that uses a text box and a combo box from a form to filter the data. I'm using the query to export the data to an excel. The query works when it is filtered by the text box but it does not work when I use the combo box. SELECT SearchAll_qry.ID, SearchAll_qry.[Alpha...
  6. H

    Pass text box value to new record on another form

    I have a form (frm_1) that has an event if the txtbox value equals "no", then it opens another form (frm_2) on new record. Private Sub txtYesNo_AfterUpdate() If Me.txtYesNo.Value = "no" Then DoCmd.OpenForm "LatePR_frm", , , , acFormAdd End If End Sub frm_2 opens on a new...
  7. H

    Renaming exported query

    I have a button that exports a query to an excel. The issue is the name of the query is in the file name. Is there a way the user has to enter a file name? My code is: Private Sub BtnExport_Click() On Error GoTo Err_Handler DoCmd.Requery (ListboxExport_qry) DoCmd.OutputTo...
  8. H

    Text and combo boxes

    I have a text box where the user enters part of a number. the subform show all record that have part of that number. The combo box show all source of figures associated with that part number. The problem is when I make a selection with the combo box it disregards the text box and shows me...
  9. H

    Cleaning Code

    I'm writing some code to hide the text box if the value is null. I have twenty text boxes. I'm using the code below, but I was wondering if there is cleaner way of doing this. Private Sub Form_Current() If IsNull(Me.Text0) Then Me.Text0.Visible = False Else Me.Text0.Visible =...
  10. H

    Exclude Zeros from query

    The query below returns a number of records that have a value of zero. How do I exclude those records? SELECT Len([MasterList_tbl]![AdditionalFig])-Len(Replace([MasterList_tbl]![AdditionalFig],",","")) AS Fig, MasterList_tbl.MasterNum...
  11. H

    Update Table based on two tables

    I'm trying to create an update query. The update will be based on the QTY, Price, and Unit. In the code below I've done the first part of the formula. Inside the false section of the IIF statement I need to lookup the value of the Unit in another table then divide the (QTY*Price). The...
  12. H

    DLookUp issue

    I have a text box on a form that looks up the number of vehicles in another table. there is only one value in the table. =DLookUp("Number of Vehicles","NumberOfVehicles","[Number of Vehicles]=" & [Me]![Text66]) Number of Vehicles is the column name NumberOfVehicles is the table name Text66 is...
  13. H

    Copy columns to another table and separate records with commas

    I have an access table that contains data similar to the first table below. (There is more but I don't need it for this part) MasterNum FIG ITEM Additional Fig Additional Item 88 BULK 24 130, 155, 157 22, 6 89 4-2 25, 212 11, 14 I'm trying to come up with a way to copy the...
  14. H

    Track changes in subform

    I'm trying to track changes made to a subform. Anything added, deleted, or editted will be recorded in a table called Audit_tbl. When I make a add or edit a record i get a 3001:Invalid argument error. I'm calling the function in the form as Before Update event procedure. Attached are the...
  15. H

    Export Subform to excel

    I'm trying to write some vba to export filtered records from a subform. I've found a number of post related to this issue and I've cobbled the code below from those post. When I run it I get a run-time error saying the Object '__temp' already exist. When I click debug it highlights the line...
  16. H

    synchronizing horizontal bars on two subforms

    I have a form that has two subforms that are in data sheet view. is there a way to synchronize the horizontal bars on both subforms? So when the user scroll to the right both Subform1 and Subform2 stay insync.
  17. H

    Filter subform with combo box using VBA

    have a combo box on a form that I want to filter a subform (SubSearchMaster_frm). I getting a runtime error 3464: data type mismatch in expression. the code is below. Private Sub CboNIIN_AfterUpdate() Me.SubSearchMaster_frm.Form.Filter = "[NIIN] = " & Me.CboNIIN...
  18. H

    Query duplicates and blank

    I think I should know this... I'm trying to find duplicates records on two table and blanks. I've linked two tables and it shows all the records that are in both tables. But I can't get it to include all the records that are empty in the ecp effectivity column. SELECT REV1Val_WP_Tracking.*...
  19. H

    Close Queries if no records

    I've seen multiple post of closing a query if it is blank. But my code checks to see if a check box is clicked then moves to the next box. If a check box has been clicked it opens a query. I'm trying to get it to close the query then return a msgbox if the query is blank. I get the first...
  20. H

    pass combo box value to another form's combo box

    I have a combo box and a button on a form. I would like the go to the record selected in combo box on another form when the button is clicked. Also, the first form is closed when I click the button too. Private Sub Edit_Click() DoCmd.OpenForm "3rdfrm_AddEdit" DoCmd.GoToRecord , acNormal...
Top Bottom