Link to home
Create AccountLog in
Avatar of Rias
RiasFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Better way of writing the code

Hello,

  Is there a better of writing this code rather than repetition:

    If Me.BtnEditRecordHotelID.Enabled = True Then
                    ClsFrmMain.FormatMessage(3, "HotelID Update : ", "", "HotelID Update")
                Else
                    ClsFrmMain.FormatMessage(3, "HotelID Update : ", "", "HotelID Update")
                    Exit Sub
                End If

Open in new window


Cheers
ASKER CERTIFIED SOLUTION
Avatar of Paweł
Paweł
Flag of Switzerland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Ryan Chong
   ClsFrmMain.FormatMessage(3, "HotelID Update : ", "", "HotelID Update")

  If Me.BtnEditRecordHotelID.Enabled = False Then
        Exit Sub
End If

Open in new window

Avatar of Rgonzo1971
Rgonzo1971

Hi,

maybe
ClsFrmMain.FormatMessage(3, "HotelID Update : ", "", "HotelID Update")
If Me.BtnEditRecordHotelID.Enabled = False Then Exit Sub

Open in new window

Regards
Avatar of Rias

ASKER

Cheers!