First Initial

Mar 7, 2006

How do i trim a name in a string.

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?

thanks.

View Replies


ADVERTISEMENT

Retrieving First Character (initial) From Forename

Oct 31, 2006

hi, im a bit stuck. i am creating a mail merge and i want access to retrieve only the first character of the forename to input into the mail merge.

e.g. Dear Mr. R Price.

I want the 'R' to be retrieved by access from the full forename, so 'R' would be retrieved from the name Robert in the forename field.


Thx

View 4 Replies View Related

Queries :: Syntax To Remove Initial?

Apr 10, 2015

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.

View 14 Replies View Related

Forms :: DLookup Without Initial Characters

Feb 12, 2015

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?

View 5 Replies View Related

Forms :: Initial Population Of Combo Box

May 6, 2014

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

View 3 Replies View Related

Modules & VBA :: Combo Box Display Initial Value

Sep 3, 2013

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:

tblRegion
regionAbbreviation (Text, PK)
regionName (Text)
regionOverseer (Text, Foreign Key...essentially a parameter)

[code]...

Some relational constraints of which to be aware:

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.

View 7 Replies View Related

How To Set Autonumber With Current Year As Initial Value

Jun 30, 2013

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...

View 4 Replies View Related

Extracting Middle Initial From Text String

Dec 21, 2005

Hello,

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.

Please help!

thanks,

Pablo

View 5 Replies View Related

Extracting Middle Initial From Text String

Dec 21, 2005

Hello,

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.

Please help!

thanks,

Pablo

View 14 Replies View Related

Modules & VBA :: Initial Folder Of Open File Dialog

Apr 27, 2015

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)

[Code] .....

View 11 Replies View Related

Forms :: Set Initial Sort By Two Columns Keeping Highest Priority

Jun 3, 2015

I have a form presented in datasheet layout.

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.

View 13 Replies View Related

Queries :: Using Variable In A List Field Query - Getting Complete List On Initial View

Mar 28, 2014

In my access form I provide the user a list of locations from various countries in a listbox . But the list is too long so I provide him a combobox for selecting a country. Selecting the country should update the listbox showing only the locations in that specific country.

So my SELECT from the listbox must cover the unselected state and show all entries and when a country is selected it must narrow the selection.

I tried to get this happen with the following SELECT statement containing a variable. Choosing a country in the Combobox results in a change of the variable and in a requery. This works after the first country is selected and for each country change, but the initial list is empty.

VBA in the loadform
'Application.TempVars.Add "varcountryselect", "*"
SELECT in the listbox "lstlocationsperproject"
SELECT tbllocations.locationID, tbllocations.country, tbllocations.localstreet, tbllocations.localcity FROM tbllocations WHERE ((tbllocations.country) Like [TempVar]![varcountryselect]);

VBA in the combobox
Application.TempVars("varcountryselect") = [Form]![kombcountryselect].Column(0)
Me.lstlocationsperproject.Requery

The values in [kombcountryselect].Column(0) are texts like "SPAIN", "MEXICO", etc.

Any hints, how I have to use the * for getting the complete list on the initial view ?

View 5 Replies View Related

Modules & VBA :: Filesystemobject File Picker Does Not Highlight Initial File

Jun 20, 2014

I am using the following code to select files using Microsoft Office's file dialog:

Public Function fTestFilePicker() As String
Dim fdFileSelection As Office.FileDialog, lstrFileName As String
Const kInitialFile = "F:TestbedTest.txt"
Set fdFileSelection = Application.FileDialog(msoFileDialogFilePicker)
With fdFileSelection
.AllowMultiSelect = False

[Code] .....

When I execute it, the file picker goes to the right folder but does not highlight the file test.txt even though that file name shows in the File name text box. Is there any way to correct this?

View 7 Replies View Related

Update Query To Add A "." To Middle Initial

Mar 2, 2006

Dear All:

I have a database with ID_Number, Last_Name, First_Name and Middle_initial. This database has 500 records.

The Middle_initial field is populated with a letter. I wish to add a period "." after each letter in the Middle_initial field only.

Any ideas on how to use an update query to accomplish this?

Thanking in advance.

Dion

View 2 Replies View Related

Add Security To A Table If Table Is Created After Initial Security Is Set Up

Oct 26, 2011

Is it possible to do this through vba. If security is setup for all the tables and a user goes in and creates a new table, can that table have security applied to it using code?

So maybe the creator of the table has read/write privileges but everyone else only has read only.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved