473,698 Members | 2,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Field Caption property

Hi,
I have posted this question on another site but had no luck so far. Sorry
about multiposting to those who have seen it.

I wish to add the field captions programmaticall y to the fields properties
when I am creating the database (VB5 DAO3.6) but caption does not appear on
the properties
list.
I'm sure it must be posible, and probable simple but I can't find out how.
Anybody know please.

Richard
Sep 27 '06 #1
6 8158
Even caption doesn't appear in the properties list i think it exists.
Just type it and see what happens.

Sep 27 '06 #2

"Svetlana" <Ac**********@y ahoo.comwrote in message
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
Even caption doesn't appear in the properties list i think it exists.
Just type it and see what happens.
Property not found error!
Sep 27 '06 #3
The Caption property won't be created by default, so use the CreateProperty
method of the field to manufacture a property object, then append that
property object to the fields' properties collection.

I think the caveat here is that the table has to exist in the TableDefs
collection before field properties may be appended.

--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200609/1

Sep 27 '06 #4
Untested code, no error handling, adjust where you feel.

Sub makeField(cTabl e As String, cField As String, nType As Long,
cCaption As String, Optional nSize = 50)
'Access 97, using DAO
Dim db As Database
Dim td As TableDef
Dim fd As Field
Dim pr As Property
Set db = CurrentDb
Set td = db.TableDefs(cT able)
Set fd = td.CreateField( cField, nType, nSize)
Set pr = fd.CreateProper ty("Caption", dbText)
pr.Value = cCaption
fd.Properties.A ppend pr
td.Fields.Appen d fd
End Sub
Richard schreef:
"Svetlana" <Ac**********@y ahoo.comwrote in message
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
>Even caption doesn't appear in the properties list i think it exists.
Just type it and see what happens.
Property not found error!

--
Bas Cost Budde
Holland
Sep 27 '06 #5
I routinely add properties to objects that are not yet collection
members. Don't think that is a problem.

You could wrap CreateProperty in a routine that first tries to set the
value of the property using dot notation, and if it fails on
PropertyNotFoun d makes an excursion to CreateProperty. Does that make sense?

RichardP via AccessMonster.c om schreef:
The Caption property won't be created by default, so use the CreateProperty
method of the field to manufacture a property object, then append that
property object to the fields' properties collection.

I think the caveat here is that the table has to exist in the TableDefs
collection before field properties may be appended.
--
Bas Cost Budde
Holland
Sep 27 '06 #6

"Bas Cost Budde" <b.*********@de v.null.comwrote in message
news:ef******** *@localhost.loc aldomain...
>I routinely add properties to objects that are not yet collection members.
Don't think that is a problem.

You could wrap CreateProperty in a routine that first tries to set the
value of the property using dot notation, and if it fails on
PropertyNotFoun d makes an excursion to CreateProperty. Does that make
sense?

RichardP via AccessMonster.c om schreef:
>The Caption property won't be created by default, so use the
CreateProper ty
method of the field to manufacture a property object, then append that
property object to the fields' properties collection.

I think the caveat here is that the table has to exist in the TableDefs
collection before field properties may be appended.

--
Bas Cost Budde
Holland

A Big Thank You to you all.
I have it working now.
I had tried 'CreateProperty ' but at the same time as creating the field
which did not work.
I now add the caption properties after all the table have been created which
works fine

Thanks
Richard
Sep 27 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3775
by: Randall Sell | last post by:
Can anyone confirm if I am being an idiot, or is this a bug in the CSS implementation of Netscape 7.x/Mozilla 1.4 ... give the following single HTML: <html> <head> <style type="text/css"> <!-- caption {
2
2932
by: Danny | last post by:
I have to make a database that will export to a tab delimited file, but the requirements are a field name with a . in the field so Is it true access will not allow this? If not, how can I get around this? Thanks
2
1840
by: LoopyNZ | last post by:
Hi, (Access 97) I'm creating a query (QRY_SUMMARY) to join a query (QRY) to itself (QRY_1). I'm returning QRY.* and selected fields from QRY_1. With each field (field_name) I return from QRY_1 I'm appending "_1" to to the end to avoid name conflicts with the fields from QRY, i.e. "field_name" becomes "field_name_1".
18
18396
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on a remote update of tables and fields and can't find enough information on these things. Also, how do you index a field in code?
2
9778
by: Gary T. | last post by:
I have a subform (that is linked to a table) in a blank form. When the table is viewed in its subform state in the form, the headings are not user friendly. ie. CustN I would want it to read in the subform heading column as Customer Name without affecting the actually field heading in the table itself..... if that makes sense. Any suggestions? thanks
5
2663
by: tsnyder | last post by:
I need to have an option button that allows editing to a field only when it is checked.
2
7984
by: Greg Strong | last post by:
Hello All, Is it possible to change table field lookup properties in code? I've been able to change other field properties in code, however so far no luck with field lookup properties. What I've done for test purposes is use a text input file for the table field lookup properties. I thought that I'd start first by just changing the 'Display Control' property. Thanks to Allen Browne for some ideals per...
4
1947
by: mosscliffe | last post by:
I have been messing with the above all afternoon. I must just be thick I am using an AccessDataSource I have tried modifying the select but I can not find the right syntax to concatenate the LIKE part of the test by surrounding my textbox field value with a leading and closing %.
15
6162
by: Ajani | last post by:
Hello Good Morning, I am currently trying to change the Caption Property value within a table by allowing the user to type into a textbox and then click on the Submit button to change the Caption for the field within the VB Script. Basically I have a form called "Enter_Table_Headings". Located on the form I have a textbox labeled "CapChange". The table is Named "tblInUnit" and the database is labeled fin_db. I've been bashing my head on...
0
8683
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7741
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.