I run duplicate check on a form to make sure the file name doesn't match one that's previously been entered. Currently I have:
If Me.NewRecord Then
If Not IsNull(DLookup("File", "tblFileProcessing", "[File]=""" _
& Me![File] & """" & " and [FileClientID] = " & Me![FileClientID])) Then
DoCmd.OpenForm "frmDuplicateFiles", acNormal, , , , acDialog
End If
End If
However we've recently changed the way we work and have now added a unique ID number prefixed to the file name: 567_File_Name_1 How do I run the DLook up but parse off the digits prior to the first underscore and only check on the remainder of the file name?
I have an asset database I am designing to manage our computer inventory and assets.
I am trying to get a DLookup to work with one of my forms that will auto-populate some of the fields depending on what is entered in to the ProductID field. For instance, Make, Model, Asset type...
My problem is that the string that returns contains special characters, specifically "#" and gives me the error message -
Run-time error '3075': Syntax error in date in query expression 'productID=EN371UA#ABA'.
My expression is definitely working, it just looks like it things it has something to do with date/time which it does not. Unfortunately, most HP equipment contains a # in the Product ID number.
Here is my expression -
Private Sub ProductIDCombo_AfterUpdate() Make = DLookup("Make", "productlist", "productID=" & [ProductIDCombo]) End Sub
Make is the field I am looking up from the ProductList table. The Product ID is the ID I'm looking up from the ProductList table to find the make. My problem is actually getting it to return the correct value of "HP or Dell or Lenovo". etc.
I have a form set up so that a supplier code combo box is populated with a simple SQL statement to get values from a lookup table. I have a second combo box that is populated when the supplier code is selected by the user. It works well. For example, if the user selects supplier Dog then the current record value of the Product field is displayed and the combo box shows all Dog products. So that's great.
My problem arises when the form loads. I can't convince Access to fill the Product combo box with the current products. For example, if the first record has Cat as the supplier, I want it to display the Product value for the first record and to show all the Cat products in the drop down. It isn't doing it on load or on record navigation. It does work if the user reselects the supplier.
I have tried various events.
Right now I have the following code in the AfterUpdate event of cboSupplier: qry = "SELECT SupplierCodeProductCodeEquityTypeQuery.Product.Nam e, SupplierCodeProductCodeEquityTypeQuery.ProductCode , SupplierCodeProductCodeEquityTypeQuery.SupplierCod e, " qry = qry & "SupplierCodeProductCodeEquityTypeQuery.Supplier.N ame, SupplierCodeProductCodeEquityTypeQuery.ProductId FROM SupplierCodeProductCodeEquityTypeQuery " qry = qry & "WHERE SupplierCodeProductCodeEquityTypeQuery.Supplier.Na me = '" & cboSupplier.SelText & "';" Me.cboProduct3.RowSource = qry
I set the initial sort by two columns, but I would like to keep highest priority for that initial sort, so when user wants to sort by some other columns that sort happens inside my initial sort.
I have 2 rows with firstname in one and the second has surname. if i wanted to view the results to have A Einstein rather than Albert Einstein, how would this be done?
I have table where First Name, Last Name and Initial are all in one field. What is the syntax to remove initial? Been playing with Right and Len with no success, I'm sure this has been done before.
I have 2 Comboboxes, one for Region and one for Country, and am attempting to initalize/cascade them. Here is the basic info for the the underlying tables:
1. Every Region has at least one Country 2. Every Region has one and only one Overseer 3. An Overseer may be responsible for more than one Region
Characteristics of the Comboboxes:
1. Both use 2 columns with the Name field (first column) being displayed and the Abbreviation or Code field (second column) being the bound column. 2. The nominal case is that both comboboxes will have multiple items to select and in that case the comboboxes are initialed with a query containing a UNION that inserts the string "<ALL>" (same string in both columns). 3. When the case arises that an Overseer manages a single Region or a Region contains a single Country, the Union query is bypassed such that the "<ALL>" string is excluded.
The comboboxes are used to create a filter condition to drill down into a potentially very large recordset.Now to the issue at hand ...
The Region combobox is initialized first. The initialization is accomplished by setting the RowSource property to an appropriate query. The first entry in the item list is then loaded to the combobox Value property by the following line of code:
Me.cbxRegion.Value = Me.cbxRegion.Column(0,0)
This always works whether there are multiple items or just one. If there is just one I set the Enabled property to FALSE; no point in reselecting the only item avaliable.The Country combobox is then initialized in a similar manner using appropriate code that is virtually identical to that used for the Region combobox.The problem I am having is that if there is only a single Country, the Name is not displayed in the combobox but is contained in the selection list. Note that i do not have a problem with the Region combobox when it is initialized with a single Region.
I have searched this forum and others and found similar inquiries and a couple of possible solutions; some clearly don't work while others appear to but result in run-time errors later in the execution of the code (run-time error '2115').I do not have a simply test case I can upload at this time; also new to the forum and appear to be restricted as to my ability to perform uploads.
I want access to generate for me an autonumber, but with the current year as initial value. ( To give new hired employees a unique number). For example, we are now in 2013
If there a new hire, that employee is going to get a unique number 2013001
The next new hire, will get 2013002 and so on
I know how to append a table to set the initial value, but this means, that next year I will have to append a new table again to set the initial value to 2014.
I want access to do this automatically for me, so that next year a new hire will get the unique number of 2014001, the next one will be 2014002 etc...
Is there an easy way to split a full name into firstname, middle name and lastname? I have a field name with names such as James R Lowes and i would like to split the name in 3 like. Firstname : James Middle Initial: R Lastname: Lowes
I was able to find a module to extract the first name from a string, but don't know much about VB and cannot figure out to do the rest.
Is there an easy way to split a full name into firstname, middle name and lastname? I have a field name with names such as James R Lowes and i would like to split the name in 3 like. Firstname : James Middle Initial: R Lastname: Lowes
I was able to find a module to extract the first name from a string, but don't know much about VB and cannot figure out to do the rest.
I am trying to display an open file dialog window so that the user can pick up a file. I wish the window to show a specific folder. How can I do this? The code I am using is below. The parameter InitialFileName has no effect on the outcome.
Code: Function GetFileName(strPath As String, imtype As String) As String On Error GoTo Err_GetFileName Dim Dlg As FileDialog Dim sfl As FileDialogSelectedItems Dim sflitem As Variant Set Dlg = Application.FileDialog(msoFileDialogFilePicker)
In my database there is one value that requires the use of a /. (This is not as a name of anything...just a value stored in one of the fields.) I have a form which functions beautifully in all other regards, but it produces an error about syntax of the subquery in the expression if I try to use this value as a criteria for a search/filter (screen shot of error message attached).
I've tried using double quotes and square brackets around the / and a in front of it to no avail. I don't have the option of changing the value...it is defined by this multi-billion dollar project. Again, this is just a piece of data in a field in a record which also needs to be a criteria in some searches/filters.
I have a table with a huge master list (some hundred thousand) of unique bar code tags, which either have 8 or 12 digits. (Valid characters are "012 345 678 9ACEFHJKLMNPRYXW"). I created a form, which is automatically looking up valid records as the string is entered position by position from left to right. This is working fine and sufficient in 99% of the cases.
Sometimes characters are not readable on the original document, so I need a tool/form, were I can enter only the readable positions of the code and the tag list is then filtered accordingly. For that, I created a separate form with 12 text boxes for each possible position of the bar code and a listbox. This list box should be filtered as the readable characters are entered in their respective positions/textbox.
Is there a way to increase the maximum characters allowed in an expression of a macro setvalue action ?
I have an expression in a macro setvalue action that adds multiple form textbox values. I need to change the form name from "RATING ENGINE 2" to "E RATING ENGINE 2". When I do this, I exceed the maximum characters allowed in the expression. Is there a way I can rename "RATING ENGINE 2" without this problem. The expression is as follows:
I'm trying to build a form that Pulls data from several tables, though will update only one. I'm having issues right now with a field that is supposed to draw from a query. I made a query that is supposed to concatenate different fields in another table, look for duplicated words and remove them, but although that isn't working yet, that's not my issue. My issue is that the DLookup in the form isn't even trying to look at the query. The query prints out workshop IDS and a concatenated field right now, so there is data to pull.
=DLookUp("[Expr1]","[Posting Title Query]", "[WorkShop_ID] =" & [WorkShop_ID])
Query name: Posting Title Query Query Reference Field: WorkShop_ID Query Data Field: Expr1
Form Name: Sessions Form Reference Field: WorkShop_ID Form Table: Session List
I have a new Customer Form(Profile) and I have the same customer data in another Table(Contacts).
I create a Dlookup... the system pull the data correctly from my Combobox but when I try to close the form, the system display a error like: The first name is empty...
I think the Dlookup need something to update the new table.
I am having a problem with computation of monthly actual generated from the Amount column which is in a purchase order table..... The monthly budget amount is generated in a query named category query... I have computed like Jan Feb Mar till Dec the column fields in the query.... A form named PO form has been created with the category item combo box ....
The problem is when a user selects a combox box he or she is presented with the monthly actual textbox that shows the amount computed( on a fiscal basis(not calendar days)) and that is done by looking up at the date converting into a month and then computing the amount for that particular category item selected...sum done if there was the same category item like repairs and maintenance done for this amount on the same month different date...I need a way to look up at the date convert into a month and then show the sum in the field textbox using the Dlookup function ..>Can this be done??)
Monthly budget I cant figure a way to get the monthly budget by looking up at the date and show the computed amount on a "fiscal basis" since the monthly budget for different months jan feb mar is computed seperately in seperate fields in the query
I have a form for new customers. One of the fields is the product they have chosen ("new model", "old model", etc.) in a drop down Combo box. I want default pricing to appear in the form based on the what user selects for the product. But, I am getting nothing shown in the price box after choosing the product.
I've tried two approaches but with no luck. What am I doing wrong? This is in the default property for "price"
Database has a form on which the user is to select a PP Type. This is a choice of up to 8 different kinds of types. There is a table in the database that keeps track of what each of these types are, either a pallet or a case. I need to create an unbound text box on the form that will display wether the chosen Type is a pallet or case. I understand DLookUp is the way to go on this but I am having a problem with the where clause part of the code.
What I am trying to write here is display in the text box the "Pallet Case" field in the "PP Type TBL", where the "PP Type" field of the "PP Type TBL" is the same as the selection in the combo box name "Type". PP FRM is the name of the form I am working on and where the text box is as well as the combo box.
I have two tables each containing fields Brand, Form, Area. Table 1 has some other information that needs to be gathered (data entry) and Table 2 is just a reference table for changes to these areas. This reference table has an additional field labeled area point value which is the value I want to "print".
The form is based off of Table 1 and has all of the fields I want the users to input. Stripped down, I have three combo boxes for the user to choose Brand, Form, and Area...I also have an unbound textbox control where I want the area point value to based off of the value of the three aforementioned boxes.. I believe this can be achieved with a lookup but I've never actually used a lookup in a control this complex before...
I'm making a form for colleagues to use which will eventually populate a table. I'm using DLookup to populate some of the fields in the form from another table. The problem is that for a few of the fields in that other table, the values are incorrect.
(Obviously the most sensible thing to do would be to amend the source data but for various reasons I cannot do that.)
For example, "date built" in the original table might be "f" but that needs to be changed to "h", so I tried the following but it doesn't work: .................................................. ............................................
If DLookup("date_built", "dbo_meas_questionnaire", "[meas_id] = Forms!FrmRetestSearch.numOrigId") = "f" Then Me.TxtDateBuilt = "h" Else Me.TxtDateBuilt = DLookup("date_built", "dbo_meas_questionnaire", "[meas_id] = Forms!FrmRetestSearch.numOrigId") End If .................................................. ..................................................