Why am I getting a type mismatch here!? [resolved]
I'm using this code to display a random advert in a form (either ad1.bmp, ad2.bmp or ad3.bmp) but it keeps failing with a compile error - type mismatch at the last & sign in the code.
Any ideas why?
Simon
Code:
Private Function RandomInteger(Lowerbound As Integer, Upperbound As Integer) As Integer
RandomInteger = Int((Upperbound - Lowerbound + 1) * Rnd + Lowerbound)
End Function
Code:
Randomize
picAdvert.Picture = (App.Path & "/ad" & RandomInteger(1, 3) & ".bmp")