Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coding of form names 1

Status
Not open for further replies.

eon5

Technical User
Dec 31, 2007
47
ZA
Good day,

I have Report names and Form names in a “Listbox”

“Bill of Material”
“Vendor Information” etc.

I only experience the following problem with the Form names and not the Report names.

When I do my coding like:
Forms!VendorInformation!.VendorID.Setfocus
The coding forces me to concatenate “Vendor Information” to “VendorInformation”, this then forces me again to change the “Vendor Information” to “VendorInformation” in the Listbox.

It would be easier and neater for my client to select, “Vendor Information” from the List Box instead of, “VendorInformation”


Any Ideas will be appreciated

Thanks
Theuns
 
Why not add a hidden column to the list showing the actual form name and then use that column as the value? In general spaces in names are best to be avoided if at all possible.
 
How are eon5 . . .

. . . or just remove any spacing before use:
Code:
[blue]   Dim frmName As String
   
   frmName = Me![purple][b]ComboboxName[/b][/purple].Column(1)
   frmName = Replace(frmName, " ", "")
   DoCmd.OpenForm frmName[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Does Forms![Vendor Information]!VendorID.SetFocus work? Also I assume there isn't a full stop after the '!' before VendorID in your code.

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top