473,396 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

First initial only in field on form

111 100+
Hey guys,

I have a table that is linked to an Excel spreadsheet that imports a few different fields such as last name, first name, etc...

i also have a form(frmBook) with a subform(frmSheet) that reflects this info, but on the form i only want the first initial of the first name to show. So im using:

Expand|Select|Wrap|Line Numbers
  1. initial = Left([First name], 1)
  2. Forms![frmSheet]![First name] = initial
how do i assign the value of initial to the FirstName field on the subform? I have my code in the OnOpen event of frmSheet, but it doesnt recognize it. I get an error saying "you cant assign a value to this object".

Is it because the table is linked that i cant edit it? How do i work around this?
Oct 1 '07 #1
3 2512
mlcampeau
296 Expert 100+
Hey guys,

I have a table that is linked to an Excel spreadsheet that imports a few different fields such as last name, first name, etc...

i also have a form(frmBook) with a subform(frmSheet) that reflects this info, but on the form i only want the first initial of the first name to show. So im using:

Expand|Select|Wrap|Line Numbers
  1. initial = Left([First name], 1)
  2. Forms![frmSheet]![First name] = initial
how do i assign the value of initial to the FirstName field on the subform? I have my code in the OnOpen event of frmSheet, but it doesnt recognize it. I get an error saying "you cant assign a value to this object".

Is it because the table is linked that i cant edit it? How do i work around this?
Instead of using VB to do this, why don't you just create a textbox on your subform with =Left([First name], 1) as the expression?
Oct 1 '07 #2
Neekos
111 100+
wow - i completely overlooked such a simple solution.

Thanks!
Oct 1 '07 #3
mlcampeau
296 Expert 100+
Not a problem. Good luck!
Oct 1 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: TekWiz | last post by:
I've got a system that automatically generates a form. I have it set up so that the backend will return to the inital form page with an error object in sessions data (assuming the backend detected...
3
by: t-ball | last post by:
I am new to the world of ASP, and at the same time VBscript (also a firt time poster). I am currently creating a multiple page form where the information on the first page needs to be validated....
1
by: Galina | last post by:
Hello I am trying to create a table, which includes a field type LONG. The wizard hasn't allowed me to enter storage settings for this table. It set the initial size is 64K and not available to...
2
by: dsnyder | last post by:
This HTML has a bit of Javascript at the end that puts the initial focus on the userID field. It works great on Windows2000 running IE6, but the initial focus never goes to the userID field on...
3
by: Jason A. Thompson | last post by:
Dear Access Gurus, I have a database which I hoped to use to administer questionnaires, or rather that someone who knows nothing about Access could use to administer them. Each q'aire item is on...
5
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
4
by: Keith | last post by:
Hello - this started out as a minor annoyance - and now is starting to bother me more and more - I'm hoping someone can help me. I would like to have a combobox display - NOT initially be blank...
1
by: jsaps33 | last post by:
Hi All, I'm wondering how I would change an initial value to a blank value if nothing gets entered into the text field. I have a form with multiple fields that visitors can enter data in to get...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.