Automatically Inserting A Date When A Item Out Of A List Box Is Selected
Aug 28, 2003
I have a MS Access database, which contains three main tables. With these I have a completed table, which holds either Yes/No within it.
One of the tables, I have linked to the Completed table as a list box, which when a job has been completed, either yes or no can be selected.
But, what I want to happen, is, when the Yes is selected, I want Access to insert the date the 'Yes' was selected, so that the employee cannot lie about the date the job was completed.
Hope I have explained this in a good enough fashion.
I don't have a clue how to go about it, could anyone help.
My list box will be used to populate a form, is it possible that once the item is dble-clicked, it reverts to a different color to let the user know it has already been selected once or can the row be locked once it has been selected?
Show me the selected item in a Listbox without looping in the whole list, because my Listbox is multiselect and I want only the item that selected recently.
I have a simple listbox (single column, no multi-selection).I want to enable a command button when the user selects an item in the listbox / disable it if no items are selected.I'm using the AfterUpdate event of the listbox, as follows :
Code:
Private Sub lstOptions_AfterUpdate() Select Case Me.lstOptions.ItemsSelected.Count Case 0 Me.comConfirm.Enabled = False Case Else Me.comConfirm.Enabled = True End Select End Sub
But when I select an item from the listbox, and debug the code, the Count is always zero? Even though I can see the item selected??
the people that i am creating a database for are wantingto have a "date" field but they dont want to manually input it. they would like the date to automatically update to todays date when they start entering the details.
I am trying to get the current time to display in the same record as an identity number. I am using a barcode scanner to identify the ID number. Using a program called BC Wedge it will place the ID number into a field in a table of the database. I also want it to record the current time the ID number was scanned. I tried setting the default value of the 2nd field to Now(), however this does record the current time, but in a new record. This basically gives me a list of ID numbers from the barcode scanner and a list of recorded times, however all the times are one record out.
Is there anyway to get the recorded time to be placed in the same record as the ID number?
As far as I am aware the BC Wedge software needs to have the table in table view, although I may be wrong about this.
I have a main form with several continuous subforms on it. These subforms are based on a selection of fields of a complete and editable form, so these subforms are overview forms so to speak. Whenever a field of a certain record is clicked, the other subforms show the linked data for that record, whenever a field of a certain record is double clicked, the corresponding form opens so data can be edited.
I would like to show which record is selected (record selectors are not enabled) in the way you select text in any application in windows. So when record A (holding fields A1, A2, A3 and A4) is selected in any way, the text should be lit up as if struck with a text-marker pen.
How do I go about that?
It would really be nice, since there is a cascading effect of records going on in the main form, which can get a bit confusing if you have to or want to glimpse at which record is selected. So for ease of use, this feature would really be nice.
I have created listbox with one column (contains one column only), now i would like to display all the characters of list item (want scroll bar to listbox).
How do i display all text of list item, I have already fixed Column Widths to max length (22";0.1"). However when scrolling to right, it is going to next blank column of list box, which is created only to change Column Widths property.
I have a frmServiceOrder form that has a "datasheet type" sfrmSOItem subform with a combo box that allows a user to select service order items...
Problem: When I select a service order item in the dropdown, it doesnt place the item in the record...I have to select it a 2nd time in order to make it appear in the record. However, if I select the item by typing (i.e., via autofill) and hit the enter key, the item will populate in the record the 1st time.
I suspect it has something to do with my query joins. I hav played with various combinations and cant find a solution...
Does anyone know how to get the columns of a listbox selected item and store it to a string? There is no multi-selection so it should be easier. I tried s$ = Me.list1.selected but it keeps giving me an error
I am having trouble with a If statement. I am trying to save a record into a table when an item is Selected (highlighted blue) in a list box. Keep in mind that my listbox is set to multiple selections. I have the following code but sometimes it works and sometimes it doest.
The reason why I am trying to get this to work is because when a item is selected I will add it to the table and when an item is deselected I will delete it from a table. See my code and pictures I have attached :
Private Sub list_audits_Click() Dim strsql As String Dim list As String Dim id As String id = Me.User_ID.Value
I have an unbound listbox "Needs", and in the onclick event have the following code which works great if I have more than one item selected, but if I only have one item selected, it does not put it in the text box "ServiceText".
Code: Private Sub Needs_BeforeUpdate(Cancel As Integer) On Error GoTo errHandler Dim ctl As Control Dim strStart As String, strEnd As String Dim aryList As String Dim varSelected As Variant
I am trying to do the following. I understand how to create relationships.However, when I create a field with a drop down selection (in this example Phone Number and Email) once that list item is selected I would like the column to the right to populate that information.So when Phone # is selected, the field to the right will populate a number for this individual.
I've designed access form with one listbox and added 'up' and 'down' buttons to move up and down the selected item in the listbox. i.e from its selected position to one item up when 'up' button clicked and same as one item down when down button is clicked. Any VBA code will do this functionality?
The user can select multiple items (non-sequential) on the listbox, say items 1 and 35313. I'd like the listbox to scroll (meaning display) to the currrently selected item, so that the user can see it while being processed.
I've seen stuff about property ListIndex, which does exactly that, but it's only useful when you have just ONE item selected (in a multiselect listbox apparently it deselects the rest of the items, so no point in using it, I guess, unless there's more to it!!).
So the key here is how to do the scrolling/display.
The code to loop through the listbox and process each selected item is attached:
Code: Dim vItem As Variant Dim Content as String For Each vItem In Me.lst.ItemsSelected 'scroll to selected item ??? 'processing of the selected item Content = Me.lst.Column(1, vItem) 'copy the content to do sth with it Me.lst.Selected(vItem) = False 'unselect the current item Next vItem 'go to next selected item
how to scroll to the currently selected item? Mind that I need to go through the list of selected items to process them for further use (i.e, I need them selected).
If the 5th option (Other) is selected, the user is required to specify what 'Other' represents.
I have created a combo box with the first 4 options and in instances of 'Other' the user can enter specific treatment that is not in the list (1 to 4).
What I would like to do is whenever the user enters a value that is not on the list (1 to 4), I would like to insert the word OTHER in front of the value entered. In other words all values not on the list will be prefixed by 'OTHER'. E.G. if 'Surgery' is entered, I would like the value 'OTHER : Surgery' to be stored in the Treatment field of the table.
This will help in the generation of statistics from the table.
Hi I have placed a Listbox in MS Access form. I use VBA. I have saved the item selected in the List box in a database. While retrieving the item from database, I want the listbox selected i.e the item should show as highlighted in the list box. Is this possible ?
HI all, the objective is to grey out an item within a listbox, where the id number is the same in another sub form. The sub form is called contacts and the list is called list15. the unique id that is linking the two is SWD.