My Assistant
![]() ![]() |
|
|
Dec 24 2008, 05:37 PM
Post
#1
|
|
|
UtterAccess Member Posts: 41 |
Hello!
I have a code below, but when I want to delete the value in the combo box I recieve an error message. I have tried to use the following code: Dim intNoSoFar As Integer intNoSoFar = DCount("*", "DanhSach", "Phong = " & Me.Phong) If intNoSoFar <= 0 Then Cancel = False ElseIf intNoSoFar >= Me.Phong.Column(3) Then MsgBox "The limit for your chosen room has been exceeded", vbOKOnly + vbCritical, "Limit Warning" Cancel = True End If When I want to delete the value inside I recieve the following error message: "Run-time error '3075'. Syntax error (missing operator) in query expression.. What i wrong with the code? Regards ltnp |
|
|
|
Dec 24 2008, 06:04 PM
Post
#2
|
|
|
UtterAccess VIP Posts: 4,622 From: North Carolina, USA |
Wrap everything after Dim and after End if in an IF block to check if there is a value first:
If Len(Me!Phong & "") > 0 Then ... the code you posted above -- Dim goes outside and above... End If |
|
|
|
Dec 24 2008, 08:27 PM
Post
#3
|
|
|
UtterAccess Member Posts: 41 |
Thank you!
Best regards Ltnp! |
|
|
|
Dec 24 2008, 08:35 PM
Post
#4
|
|
|
UtterAccess VIP Posts: 4,622 From: North Carolina, USA |
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 20th May 2013 - 03:50 PM |