Link to Data Form.

A

adn4n

Hi this may sound simple, but i cant get my head around it, ive bee
trying this for time..i would like to have a macro, so that when it i
clicked it will go to data > forms. For some reason it dont seem t
work, can anyone help
 
D

Debra Dalgleish

If you record a macro as you open the data form, the code should look
something like this:

'=======================
Sub OpenTheDataForm()
Range("A1").Select
ActiveSheet.ShowDataForm
End Sub
'=======================

The button on your worksheet should run this macro.

What happens when you click the button on your worksheet?
 
A

adn4n

when do i stop the macro recording? after i have closed the data form
it wont allow me to do it, i have tried this and an error 1004 keep
coming up in a dialogue box. i have also tried to stop the macro whils
the data form dialogue box is open, but this still doesn not work as i
stop macro recording toolbar, fade away so that i cannot click the sto
button (most likely because the data form is still opened thats why).
 
D

Debra Dalgleish

Start recording, open the data form, close the data form, and stop
recording.

The table should start in the range A1:B2, or it should be named
"Database".

XL2000: ShowDataForm Method Fails if Data Cannot Be Found
http://support.microsoft.com/default.aspx?id=213835

Also, if you're using Excel 97, the error may be caused by the command
button taking the focus. Set the command button's TakeFocusOnClick to
False, or add the following line at the beginning of the code:

ActiveCell.Select
 
A

Alfred Dearnley

I've struggled with this in the past.
Thanks for the crucial information that the table should start in the range
A1:B2.

Alf
 
Top