C
ChoonBoy
I am trying to convert a button to an item in the new Ribbon.
When I select it in the ribbon, it should give the same effect as the
button. I have not been successful and appreciate any help.
I tried to work my way with this Example I got from the net but when I run
debug I get error (User-defined type not defined), I have no missing
references.
Public Sub OnCloseCurrentObject(control As IRibbonControl)
DoCmd.close CurrentObjectType, CurrentObjectName
End Sub
Code in Button (to be converted to Ribbon)
Private Sub cmddefault_Click()
DoCmd.close acForm, "frmstart"
Me!number.Top = Forms!frmdefault!Numbertop * 50
Me!number.Left = Forms!frmdefault!NumberLeft * 50
Me!txtdayZero.Top = Forms!frmdefault!D1top * 50
Me!txtdayZero.Left = Forms!frmdefault!D1Left * 50
Me!txtdatZero2.Top = Forms!frmdefault!D2top * 50
Me!txtdatZero2.Left = Forms!frmdefault!D2Left * 50
Me!txtMthZero.Top = Forms!frmdefault!M1top * 50
Me!txtMthZero.Left = Forms!frmdefault!M1Left * 50
Me!txtMthZero2.Top = Forms!frmdefault!M2top * 50
Me!txtMthZero2.Left = Forms!frmdefault!M2Left * 50
Me!txtyrZero.Top = Forms!frmdefault!Y1top * 50
Me!txtyrZero.Left = Forms!frmdefault!Y1Left * 50
Me!txtyrZero2.Top = Forms!frmdefault!Y2top * 50
Me!txtyrZero2.Left = Forms!frmdefault!Y2Left * 50
Me!cboName.Top = Forms!frmdefault!Nametop * 50
Me!txtname.Top = Forms!frmdefault!Nametop * 50
Me!cboName.Left = Forms!frmdefault!NameLeft * 50
Me!txtname.Left = Forms!frmdefault!NameLeft * 50
End Sub
Thanks in advance.
When I select it in the ribbon, it should give the same effect as the
button. I have not been successful and appreciate any help.
I tried to work my way with this Example I got from the net but when I run
debug I get error (User-defined type not defined), I have no missing
references.
Public Sub OnCloseCurrentObject(control As IRibbonControl)
DoCmd.close CurrentObjectType, CurrentObjectName
End Sub
Code in Button (to be converted to Ribbon)
Private Sub cmddefault_Click()
DoCmd.close acForm, "frmstart"
Me!number.Top = Forms!frmdefault!Numbertop * 50
Me!number.Left = Forms!frmdefault!NumberLeft * 50
Me!txtdayZero.Top = Forms!frmdefault!D1top * 50
Me!txtdayZero.Left = Forms!frmdefault!D1Left * 50
Me!txtdatZero2.Top = Forms!frmdefault!D2top * 50
Me!txtdatZero2.Left = Forms!frmdefault!D2Left * 50
Me!txtMthZero.Top = Forms!frmdefault!M1top * 50
Me!txtMthZero.Left = Forms!frmdefault!M1Left * 50
Me!txtMthZero2.Top = Forms!frmdefault!M2top * 50
Me!txtMthZero2.Left = Forms!frmdefault!M2Left * 50
Me!txtyrZero.Top = Forms!frmdefault!Y1top * 50
Me!txtyrZero.Left = Forms!frmdefault!Y1Left * 50
Me!txtyrZero2.Top = Forms!frmdefault!Y2top * 50
Me!txtyrZero2.Left = Forms!frmdefault!Y2Left * 50
Me!cboName.Top = Forms!frmdefault!Nametop * 50
Me!txtname.Top = Forms!frmdefault!Nametop * 50
Me!cboName.Left = Forms!frmdefault!NameLeft * 50
Me!txtname.Left = Forms!frmdefault!NameLeft * 50
End Sub
Thanks in advance.