Microsoft
Software
Hardware
Network
Question : AutoFill field when a selection is Selected
Hi,
We have this Access database Form and one field with a drop down box. the table of the selection is in this form.
Selection.Field1 = NAME
Selection.Field2 = Description
and we will select Selection.Field1 records to go to the drop down selection which is Main.Field2.
The main table is in this format.
Main.Field1 = Number
Main.Field2 = Name
Main.Field3 = Description
Main.Field4 = Date
If we select the Name from the drop down menu which contains all records in Selection.Field1 we want the Selection.Field2 (description) for the selected Selection.Field1 record to be automatically placed in the Main.Field3. How can we do this?
Thanks!
Answer : AutoFill field when a selection is Selected
Well a quick way is to use the afterupdate event of the combo (drop down) box
e.g.
sub mydropdown_afterupdate()
If isnull(me.mydropdown) then exit sub
Me.Field3 = Me.mydropdown.column(1) 'this is the second column in the dropdown
End Sub
(assuming your drop down box is named mydropdown)
However, i'm not sure if your requirement is to move to the appropriate record in the main table first, but in that case the description would already be present so the update would be meaningless... so I'm hoping the above solution will help...
Random Solutions
convert date to date number
Sorting a date column in dataview
Cannot open .xls file attachments in Outlook
Windows Server 2008 r2
How do I return a datatable from a stored procedure?
MSSQLSERVER unhandled exception 80000003, Error: 17311, Severity: 16, State: 1, SQL 2005, Windows 2008
Microsoft Excel and PowerPoint 2003 print with no left margin
SQL Replication - Requires the actual server name error
access 2003 report with calculated field.
Drop all Indexes