Topics Search

Caption Property & Queries

Caption Property & Queries
Views: 36
How can I change the name of a Field in a query when the Caption Property has been set for the field in the underlying table? For example, table tblTest has a field named "Company Number". The Caption Property for this field has been set to "CompanyNbr". I want to create a query on this table and change the name of the field to "Co". I've tried "Co: [Company Number]", but the field name in the query is "CompanyNbr". I've tried "Co: [CompanyNbr]", but that results in a "Enter Parameter Value" dialog box for "CompanyNbr".

I realize I could simply delete the Caption. However, this is a database I receive weekly from an external source, and it has many fields in it.

This problem occurs in both Access 2003 &amp
Sponsored Links:

Similar posts...


Changing the Caption Property of a Query Tab ?

Changing the Caption Property of a Query Tab ? Icon
When I create forms, I often use the naming convention frmNameOfForm.
Then I will change the caption property of the form so that the tab of the form does NOT show frmNameOfForm. I replace it with something more user friendly.

I'd like to do the same for my queries.

Is it possible to change the caption property of the query so that it does not show qryNameOfQuery on the tab

Caption -- change using VBA

Caption -- change using VBA Icon
Can you change the Caption property of a form while opening the form from another form? I know Me.Caption works.

I am trying:

but get this error message:
Error Number: 2465

Record Count Caption & Stopping Next Record If Blank

Record Count Caption & Stopping Next Record If Blank Icon
would be a life saver.

Why is this caption record counter not working?

Me.Caption = "Record " & (Me.RecordsetClone.AbsolutePosition + 2) & " of " & Me.RecordsetClone.RecordCount

and how can I stop my code from clicking onto the next record when I have this on click of my "Next" button?

DoCmd.GoToRecord , , acNext.

Dynamic Datasheet Caption

Dynamic Datasheet Caption Icon
I have a form with a datasheet. I can change the field names of the datasheet by changing the "Datasheet Caption" property on the property sheet. However, it seems that I can only have a static name for the field. Is there a way to have the Datasheet Caption be dynamic?

Modifying Label Caption in VBA Code from Form?

Modifying Label Caption in VBA Code from Form? Icon
I have a form that opens a report, and before I open that report I'm trying to change the caption of a label on the report. I'm having troubles accomplishing this. The label is named lblFilter, I've tried.

Report_MyReport.Controls("lblFilter").Caption = txtDate.value
Report_MyReport.lblFilter.Caption = txtDate.value

And, it just not working. I'm not sure how to reference that label's caption property properly.

Adding reports to a combo box - caption not working.

Adding reports to a combo box - caption not working. Icon
I'm trying to add a bunch of reports to a combo box. Here's the code:

Dim varReport As Variant
With CurrentProject
For Each varReport In .AllReports
If Right(varReport.Name, 1) = "Z" Then
cmbReport.AddItem varReport.Name
End If
Next varReport
End With

Problem is that the report names are not very end user friendly, and won't really be. I'm looking for a way to add the report's Caption to the combo as well, and tried using a 2 column combo and the following:

cmbReport.AddItem varReport.Name & ";" & varReport.Caption

This doesn't work though as I get an object doesn't support this property or method error.

How do i update and save the caption for a label?

How do i update and save the caption for a label? Icon
I have a single form with a label.
Sometimes the user wants to update the caption for the label - this carries through to the report heading etc.

It's simple to get the user to change the caption using a button /InputBox, however when we close and re-open the Database
it defaults back to the original caption - not the updated one.
Is it possible to save the most recent caption as the default

Scolling Text

Scolling Text Icon
Can someone please look at this code for me. I got this code of another forum (forgot the user's name so unable to reference) but all I am trying to do is get text to scroll from left to right in smooth transition.

The below code works

Private Sub cmdscroll_Click() Dim x As Integer, y As Integer Dim Start, delay For x = 1 To 100 Start = Timer delay = Start + 1 Do While Timer < delay lbl1.Caption = Mid(lbl1.Caption, 2) & Left(lbl1.Caption, 1) lbl2.Caption = Mid(lbl2.Caption, 2) & Left(lbl2.Caption, 1) DoEvents Loop DoEvents Start = Timer delay = Start + 1 Next x End Sub

but it makes the text scroll too fast. The answer he had was to increase the delay time ie

delay = start+3000

. I have tried that to no avail.

My form has a command button as you can see from the code and 2 label boxes. The cmd button should start the scroll once clicked

Reserved Error 2950

Reserved Error 2950 Icon
Just created a report and had the following code:

Private Sub Report_Activate() TxtPurchaseOrder.Visible = True TxtPurchaseOrder.SetFocus Label17.Caption = "Thank you for your purchase order " & TxtPurchaseOrder.Text & " received " TxtDate.Visible = True TxtDate.SetFocus TxtPurchaseOrder.Visible = False Label17.Caption = Label17.Caption & TxtDate.Text & "." Text28.SetFocus TxtDate.Visible = False End Sub

Worked perfectly now i've introduced a subreport and it errors out on the second line, TxtPurchaseOrder.SetFocus giving the error stated earlier. TxtPurchaseOrder is a bound field linking to a table, the subreport is bound to a query.

.label.caption not repainting

.label.caption not repainting Icon
Using Access 2007 and trying to change a label's Caption at runtime (OnCurrent event of a form). I did DoEvents, I did Me.Repaint, but the **** label displays the same caption.

(the same is True with a command button, it changes is Caption only when I click on it)

Still, the form goes in AllowEdits and AllowDeletitions. It behaves like an event is not raised.

Here's te code: