Solved

Writing cbo value to active cell

Posted on 2010-08-19
2
296 Views
Last Modified: 2012-05-10
Hello Experts

The okClick event writes the value selected in cboEquipment on user form to the active cell.  This works fine for the cboEquipment  but the user form has two combos.  How do I add cboEmployees value if that combo is selected instead ?  

Thanks
Private Sub cmdOK_Click()
        ActiveWorkbook.Sheets("DTS").Activate
        Range("C15").Select
    Do
If IsEmpty(ActiveCell) = False Then

        ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
    
        ActiveCell.Value = cboEquipment.Value
            
End Sub

Open in new window

0
Comment
Question by:zpotok
2 Comments
 
LVL 16

Accepted Solution

by:
Sheils earned 500 total points
ID: 33479777
You can run the code for the cboEmployees after the loop

Private Sub cmdOK_Click()
        ActiveWorkbook.Sheets("DTS").Activate
        Range("C15").Select
    Do
If IsEmpty(ActiveCell) = False Then

        ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
   
        ActiveCell.Value = cboEquipment.Value

'-----------------------------------------------

ActiveWorkbook.Sheets("DTS").Activate
        Range("C16").Select
    Do
If IsEmpty(ActiveCell) = False Then

        ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
   
        ActiveCell.Value = cboEmployee.Value
           
End Sub
0
 

Author Closing Comment

by:zpotok
ID: 33480009

simple enough....  thanks
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question