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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with ActiveCell.Row... 1

Status
Not open for further replies.

SnayJ

Programmer
Feb 27, 2008
65
0
0
US

I have a Sheet of data with a button on it. When I click in a row to identify the row of information I want to use... and then click a button on the worksheet - a Form opens and I transfer the individual cell values that I want to look at onto the form. Everything works, but when I close the form and click another cell and click the button again to launch the form I see the old records. Then I have to close the form and open it again... then the new information comes up. It's like my code hasn't recognized the ActiveCell.Row has changed right away. Is there a way to make it recognize the new ActiveCell.Row before opening the form?

A piece of the code below...

Code:
    OFFICEVIEWTRANSfrm.Show
    'transfer data from ActiveRow
    OFFICEVIEWTRANSfrm!MLSNUMBERbox.Value = Sheets("Office View").Range("A" & (ActiveCell.Row)).Value
    OFFICEVIEWTRANSfrm!CLOSEDATEbox.Value = Format(Sheets("Office View").Range("I" & (ActiveCell.Row)).Value, "dd-mmm-yy")
    OFFICEVIEWTRANSfrm!STATUSbox.Value = Sheets("Office View").Range("J" & (ActiveCell.Row)).Value
    OFFICEVIEWTRANSfrm!AGENTNAMEbox.Value = Sheets("Office View").Range("D" & (ActiveCell.Row)).Value

Thanks in advance,

SnayJ
 
Hi,

This forum is for Access VBA questions. Your question is regarding Excel VBA, which belongs in forum707.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
You need two procedures.

One to open the form in the Button_click event

The second in the userform Activate event that loads the four text boxes.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Skip,

Thanks... sorry, I have 2 forums under my forum list and I clicked the wrong one.

As for your suggestion, thanks... I get it... open the form and have the form pull the information on Activate... sounds good. Thanks!


SnayJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top