Form In Datasheet Mode : Name Of Textbox Is Caption Of Column ???
May 5, 2006
My form is in datasheet mode.
One of the textbox is called txtHours
When I access the form the column caption is "txtHours" !
As you can expect it looks ugly.
So to get a decent caption like "Hours" I am forced to set my textbox name to "Hours" !
As you can expect it goes against my coding standard to do that.
Beside I want the caption of some textboxes to include some non-standard letters such as `é' è' '!' ' ' etc. and if I put those in the textbox name it ruins the visual basic code !
I have a Form in which there is a textbox. I would like the name (caption) of the Form (that shows in the tab at the top of the form) to be named/updated to whatever is entered into the textbox.
I created a form to enter the lookup data and build the SQL string to create a recordset in VBA that is a subset of the original data. Using the Form wizard I created a form that displays ALL of the records in that original table (actually a QUERY). What I want to do is open this second form but have it reference the recordset I built in VBA.
I want to use the same form in datasheet mode for data entry and retrieval. When retrieving, all controls are disabled and locked. I am trying to enable and unlock them for modifying but that isn't working.
I'm trying to show a count of filtered records on a form. The Filter is number of days from the system date which I've already built into a query. I'm trying to get the record count for each day out up to the tenth day and show the counts on a form. Is this prossible? and how is it done?
I have a Form to Display Projects that has a SubForm displaying Sub-Projects related to them. The main Project Form has a Combo Box which allows a user to select a ProjectID to display. The SubForm has a ProjectID Field as well. When the Project ID is selected in the Main Form, only the appropriate Sub-Projects are displayed in the Sub-Form.
On the SubForm, there is a Field named ActionID, which uses the following VB Code to limit the availability of the Fields in the SubForm that apply to Dates. If the selected Action is Install, only Install related Dates should be available. Likewise, if the selected Action is Remove only Remove related Dates should be available.
Code:
If Me.ActionID.Column(1) = "Install" Then Me.AssetInstallMonth.Enabled = True Me.AssetInstallYear.Enabled = True Me.AssetRemovalYear.Enabled = False Me.AssetInstallMonth.Locked = False
[Code] ....
Everything seems to work as expected until there is more than one Sub-Project is the SubForm and they do not contain the same Action. In these cases, it appears as if the Sub-Projects in the SubForm are not being treated as individual records. If Sub-Project is Added or Modified to have an action of "Install", all records are treated as Install Records (only Install related Dates are available), regardless of their content.
Is there a way to update the properties for only the row that has been selected?
I have several subform tabs and one that I have updated no longer shows up when I run the form on Form mode. The tab is there but no content or details of the subform
I'm looking for someone to help me understand why a form of mine that has only 3 fields - [Name], [Date], [Notes] isn't working right. I have the form's "Allowedits = No" which works great except when I add a macro that uses the "Setvalue" to put the current user in the name field and to put the current date in the date field the form allows editing. When I take the macro out it works the way it should. All I'm doing is creating a Journal entry area that allows one to write notes into the [Notes] field and automatically plugs in the current user and the date/time but doesn't allow editing once entered.
Some background: I have a subform that is displayed in datasheet view, with an unbound textbox (field1) whose sole purpose is to pass the date and time entered into it to field2 (hidden, bound), and also display that info in this format: ddhhnn"Z" mm yy. The inputmask for field1 is 000000"Z ">LLL�0 which forces the user to enter the date/time using the ddhhnn"Z" mm yy format. I use field1's AfterUpdate event to convert its contents into a format (dd/MMM/yy hh:mm) that field2 can easily recognize as a date and time.
My problem: The only way I've figured out to get field1 to display field2's date and time is to use the subform's OnCurrent event:
However, by doing that, whenever I click on a record's row the entire field1 column populates with the current record's field1 value. So, if I click on record 2's row, the entire field1 column populates with "101200Z JUN14" for every record. If I click on record 3's row, the entire field1 column populates with "111232Z JUN14" for every record. And so on and so forth.
How can I stop field1 from populating with the same value for every record?
I have a subform in datasheet view and I wish to selectively hide columns I'm not using (depending on the query). I wrote a small function to make it easier. Here's my code: Function HideColumn(myForm As SubForm, myLabel As String) myForm.SetFocus myForm.Controls(myLabel).SetFocus DoCmd.RunCommand acCmdHideColumns End Function So all I do is send the subform name while I'm using the parent form and then give it the column name to hide. Oddly enough this code works for columns such as "Net B" and "Net% +/-", but it doesn't work with the columns "Period B" or "Period A". On my subform the text boxes and their labels have the same name (if that even matters). I keep getting a 2465 error (field not found) no matter what I change the column name to.
my requirement was for a control in a subform and I needed all this to affect a first column freeze.The code was in the Onload for the main form.
Code:
Dim ctl As Control Set ctl = Forms("frmPlanner").Controls("subfrmTempCtrl") Me.SetFocus ctl.SetFocus ctl.Form.Controls(0).SetFocus DoCmd.RunCommand acCmdFreezeColumn
It does work but I can't fathom why I need more than the last .SetFocus. Leave any of the prior ones out and it gives an error to the effect that can't do it in those circumstances. I understand the control has to have focus for it to work but why are the other's required?
I have a crosstab query of which I cannot sort a Totals column by descending order. Is there any way to sort a certain column automatically after the query runs and is in Datasheet view?
I then use another query to sort and remove duplicate entries, using the 'Totals' option Group By and Last.
I then export the datasheet to an Excel spreadsheet.
All goes well, except that the headers on the spreadsheet show LastOfXXXX or GroupByXXXXX. Now I can run a replace function in Excel to remove LastOf and GroupBy from each column header, but it would be more useful if the replace routine was performed prior to the export to Excel.
Why Access 2010 does not save the Datasheet order?? I keep setting the order and it puts it back again
I have set the order in the design. I have set the tab index individually for each item. I says in the tab order that they are in the correct order. I reorder them in the datasheet and click on save. Nothing sets that order. It will revert it back to the order that IT wants every time.
I have a form with a subform. The subform displays records in datasheet format but is not linked to the main form.
I am attempting to get the hightlighted record on the subform to appear in the main form's caption bar. If I isolate the subform then that subform caption shows the current record on the datasheet. I can't get it to work on the main form however.
On the main form's current event I have Me.Caption = Me.Subform.Form.EmployeeID The main form caption only shows the first record on the subform.
Can anyone help me on this. I have searched everywhere Regards
In an .ACCDE I want to store the column widths when user closes a datasheet form (or subform) so that when opening it anew, the widths are as previously set by user. I could store this data in a dedicated table ( and userID, for the multiuser db), but is there a smarter way? Some array/ dictionary/ whatever as database or form property?
tell me if it is possible to calculate a value in a column in a datasheet view of a query. i.e. I want to take a value in 'Column A' and subtract the value in 'Column B' to create a value in 'Column C'?
I have a subform in which I display a table in Datasheet View. The problem is, I cannot figure out how to place the columns in the order (i.e. from left to right) I want.
For some reason, right-clicking on a column header in Form View and selecting Freeze Fields will shift that column to the left but I can find no consistent pattern to it and no other way of shifting a column. Reordering the columns in the table itself seems to have no effect on the order they appear on the subform and moving the controls around in the subform in Design View also seems to have no effect.
We are using a data sheet view to display the content of a table of colors, we would like one of the columns to display a colour chip of the RGB value it contains,
How in the world can I accomplish this? I have a set of dates on a form that change from week to week. I'd like to reference these text boxes in a query as column names. How can I do this?