Setting field of Access table using VBA from form - vba

I'm trying to set a value of a field from a subroutine which I'm calling from an event handler. I'm simply doing width = 5
However, the field value isn't changed. However I can do height = 5 and the field value is set as expected. The field value for width remains unchanged at 12186.
I've tried changing the field name to image_width to no avail.
The form has neither controls height nor width.
What am I doing wrong / why is this one field not changing. I've tried deleting the field and recreating, and I don't see anything on this field that limits the setting of data.

Every form has an inbuilt property .Width so you can't use that for a field name.
A form doesn't have .Height, since this is a property of the form sections.
image_width shold work, though. Are you sure you edited all relevant settings?
i.e. Table field name, form field Name, form field Controlsource, VBA code?

Related

VB .NET - Autosize datagridview row height

Problem Definition
So I am trying to do something that should be very basic; however, I can't seem to make it actually work. I am simply trying to make my datagridview autoresize every row height to the text entered. Am I missing something?
What I have tried
I have read through examples on SO and other sites and they all recommend a similar idea. So to make it simple here is exactly what I have done so far:
I created a new datagridview.
I clicked on columns > Add and use the default name and type (textbox)
I kept the Autosizemode of that column at None and DefaultCellStyle WrapMode to True.
I changed the datagridview's AutoSizeRowsMode = AllCells
From there I build my project and type some data in, but the column simply grows the column width and not the row height:
Am I missing a step somewhere? I purposely put every step I did because I feel like I am just missing something very simple...
go to the data grid view -->properties --> default cell style-change the wrap setting to true then use the autosizerow property as any mode like allcells or display cellslike

Set the caption of a frame in a continuous form

I would like to set the caption of a frame dynamically inside a continuous form.
So far I am doing the following:
Private Sub Form_Load()
Me.myFrame.Caption = Me.created_date
End Sub
This only sets the value of the first record for all Frames. I want the frame to have the "creation_date" of each entry of my table.
What do I have to do to make the caption dynamic ? The Frame control does not have a "Data" binding like textfields, so I think that I have to set it programmatically.
Set the Record Source of your form to whichever table/query you're using.
Add the Option Group frame to the form and delete the label.
Place a text box where the deleted label was and format as needed.
Give the text box a Control Source pointing to your date field and it should just work.
You can't do this directly.
Unbound controls like the frame caption by definition have the same value for all records in a continuous form.
The only way is to use a bound control (textbox) as workaround, as shown by Darren.

pentaho report designer display field over field2 if 'field2' is not present

Let's say I want to make 2 text fields next to eachother.
On the screenshot below you can see 2 fields. The field on the left will always show.
But if the field on the right isn't filled in, I want to make it disappear but the text from the first field would have to go over the whole width of the page.
How do I make it overlap ONLY if the other field is empty?
Basically: When field 2 is present then field 1 has to be 275 width.
When field 2 is not present (so empty ) --> Field 1 would be 475 width
You can try to define expression for width property of field1.
IF(ISERROR([coachee_conclusion_html]);475;275)
However, I am not sure about the function which should check if value is not present. In version 3.5 for example, you can use IF(LEN([coachee_conclusion_html])>0;275;475)
instead.
Possibly, you would also need to hide the right field (to prevent overlapping) by setting expression for it's visible property
NOT(ISERROR([coachee_conclusion_html]))
or
LEN([coachee_conclusion_html])>0

Add second line when a column is full from text length ultraWinGrid

Is there a way to automatically add a new line or something when a column in my ultraGrid is full? Sometimes when i load some text into a column in my ultragrid it has a longer value length than the available column field, as a result some text stays hidden. So i want when this happens to show the rest of the text in another line. Is this possible in vb.net for ultrawingrid?
You could set the CellMultiLine property as in the example below. (supposing you have one band and the column with the long text is the second one)
UltraGrid1.DisplayLayout.Bands(0).Columns(1).CellMultiLine = DefaultableBoolean.True
UltraGrid1.DisplayLayout.Bands(0).Columns(1).VertScrollBar = True
UltraGrid1.DisplayLayout.Override.DefaultRowHeight = 100
The next two lines are optional, but they serve the purpose to show immediately the column with a different height and with a vertical scrollbar

dijit.form.Combobox show label Instead of value

I've a dijit.form.Combobox field which uses a ItemFileReadStore to pull Its data.
Teh ItemFileReadStore has two attribute per Item value which will be used for form submission , generally Unique Integers and label which is Human Understandable String.
In ComboBox HTML I've done searchAttr="value" labelAttr="label"
When the ComboBox Shows the list it uses teh label Attribute.
But When the User selects one of the Item it shows the value of that Item.
What I want is , The value Attribute will Still be used for Form Submission. But the User will always see the label in the combobox Control.
alt text http://img822.imageshack.us/img822/6660/dijitcombo.jpg
e.g. I Want to Show The Label for value 3 (Admin) instead of 3
Use FilteringSelect instead of Combobox.
Note: ComboBox only has a single value that matches what is displayed while FilteringSelect incorporates a hidden value that corresponds to the displayed value.
I have tried the following.
var cmbObject = Registry.byId('combo dojo id'); var id =
cmbObject.item.<Code Property>;
You should check if item is null.