Thanks for the tip about attaching. Pat that code worked after I'd associated the label with the text box control. Originally it wasn't,
It doesn't change the Form caption though, but the label caption.
I removed the control and reapply it with it's label. This greatly simplified the column header change
Private Sub Form_Load()
If Left(Me.Caption, 12) = "Composer for" Then
Me.Label13.Caption = "Composer"
Else
Me.Label13.Caption = "Label"
End If
End Sub
I...
> I expect the Datasheet label is the ControlName only when there is no associated label.
OK, can try that. How is a label associated with a control and where in the Form does it go, the detail or somewhere else?
Colin and Isaacs changes/suggestions don't do anything if frmExtSingles is Open with view the required acFormDS.
I've since found those 4 label controls aren't actually used and can be removed. Access put them there when teh Form was designed.
Pat, the change is conditional. I did try to...
I think I have a dumbed version. Open Form1 and click button. Another Form opens and one field is headed "Label"
I want to change this to "Composer" in Function ChooseComposer (if recordCount > 0).
I couldn't put Form_frmExtSingles.Label.Caption = "something" as it errored with Method or data...
It's a popup Form launched by d-click on another Form. "Label" is a correct description. It's not critical, I can live with its caption not being"Composer", but would have been handy to know why it couldn't be changed. If column heading will take the controlsource of a bound control wouldn't...
Thanks CJ that may get me a bit further. I know have
Function ChooseComposer(sArtist, sTitle) As DAO.Recordset
'Union Query to get Composer from CDTracks and mp3Tracks
Dim sql As String
Dim Cap1 As String
Dim rs As DAO.Recordset
Cap1 = "Composer for " & sArtist & Delim &...
Isaac, you'd think that would but it gives a compile error highlighting .xlabel and saying Method or data member not found.
The Form name is correct. In design mode it shows 4 labels in the Form Header and 4 Text Boxes in the detail. The Form shows in datasheet mode. So I presume the column...
There's code for various controls and events, Yes ? I think of them as "code within the Form". I don't see a distinct "module" except as a different item in the LH Navigation column, or the Project Explorer, and I get the two confused sometimes. The code in msg #1 is not in a module but a Forms...
I've lost the plot here completely. Who's talking to who? But Pat - it's not the Form caption I want to change, but a labels caption on the Form.
I'm not familiar with the concept of a Form Vs it's module. Isn't isn't all code in the Form? I can't fathom what "Form is not in the Forms...
Thanks the replies but I'm mot quite up with what it all means. "Has Module" (which I'd never heard of) is Yes (must be the default).
Even after Googling I'm unsure what is meant by instantiated. My Form isn't a Form ??
Well, in the code block I have what instruction would change the Caption text ?
Not sure why this is giving so much trouble
Dim frm As Form
Set frm = Form_frmExtSingles
With frm
.RecordSource = sql
!xLabel.Caption = "Composer"
' Forms!Form_frmExtSingles!xLabel.Caption = "Composer"...
This is not working as expected
= Replace(Dat, " - ", "\", 1, 1)
I expected the first instance in Dat of " - " to be replaced with "\". But it replaces 2 instances.
What exactly does the ,1,1 do ?
I'd just created it. It wasn't being accessed by anything. This is something done often and no other (local drive) files have resulted in that error. I did suspect a typo but it definately wasn't. I may be able to replicate it... will advise.
The file wasn't read only or Open or locked. KIll failed (in Access), DEL from command prompt (and FSO in Access) worked.
And FSO was True.
>What if it had meant Delete parent and all subfolders?
It was a file, not a folder.
Normally Kill is ok, so it must be a Network limitation.
Gemma it was...
I was using the mapped drive letter, as part of the complete filespec in a string variable, but no Kill.
Eventually I succeeded with
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile TheFile, True
Although I don't know what the "true" does.
BTW Del from command prompt...
I'm getting run time error 75 File/Path access error using a valid & correct path and filename.
However the drive is a mapped Network drive. Is this why and any solution?
Thanks.