Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Premium Land with House for Sale
anil1961
Updated:
Today at 10:15 AM
AWS Certified Solutions Architect-Associate + AWS Certified Cloud Practitioner
Sanjeewani95
Updated:
Wednesday at 8:16 PM
🚀 එක පැකේජ් එකයි - මාසෙටම Unlimited Internet! 🌐
sayuru bandara
Updated:
Tuesday at 10:57 AM
🎬 CapCut Pro 1 Month Access! LKR 600
sayuru bandara
Updated:
Tuesday at 10:55 AM
🚀 Google One AI PRO Plan (Gemini Pro Activation) – 18 Months Access! LKR 2200
sayuru bandara
Updated:
Tuesday at 10:53 AM
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
Excel හී Visual Basic වැඩසටහනක් ලියන්නේ මෙහෙමයි
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="opishan" data-source="post: 12972452" data-attributes="member: 48155"><p><strong>Syntax Error </strong></p><p><strong>Mama Correct kara.... </strong></p><p></p><p>Private Sub cmdAdd_Click()</p><p>Dim iRow As Long</p><p>Dim ws As Worksheet</p><p>Set ws = Worksheets("Sheet1")</p><p>'find first empty row in database</p><p>iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1</p><p>'check for emp Name</p><p>If Trim(Me.txtname.Value) = "" Then</p><p>Me.txtname.SetFocus</p><p>MsgBox "Please enter EMP Name"</p><p>Exit Sub</p><p>End If</p><p>'copy the data to the database</p><p>ws.Cells(iRow, 1).Value = Me.txtname.Value</p><p>ws.Cells(iRow, 2).Value = Me.txtid.Value</p><p>ws.Cells(iRow, 3).Value = IIf(Val(Mid(Me.txtid.Value, 3, 3)) > 500, "Female", "Male")</p><p>ws.Cells(iRow, 4).Value = Left(Me.txtid.Value, 2) + 1900</p><p>ws.Cells(iRow, 5).Value = IIf(Val(Mid(Me.txtid.Value, 3, 3)) > 500, Val(Mid(Me.txtid.Value, 3, 3)) - 500, Val(Mid(Me.txtid.Value, 3, 3)))</p><p>'clear the data</p><p>Me.txtname.Value = ""</p><p>Me.txtid.Value = ""</p><p>Me.txtname.SetFocus</p><p>End Sub</p><p></p><p>Private Sub cmdExit_Click()</p><p>x = MsgBox("Are you sure you want to exit", vbYesNo, "Sure")</p><p>If x = vbYes Then</p><p>Unload Me</p><p>End If</p><p>End Sub </p><p></p><p><strong>Any Way nice Code........</strong></p><p><strong>Thanks......</strong></p></blockquote><p></p>
[QUOTE="opishan, post: 12972452, member: 48155"] [B]Syntax Error Mama Correct kara.... [/B] Private Sub cmdAdd_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Sheet1") 'find first empty row in database iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1 'check for emp Name If Trim(Me.txtname.Value) = "" Then Me.txtname.SetFocus MsgBox "Please enter EMP Name" Exit Sub End If 'copy the data to the database ws.Cells(iRow, 1).Value = Me.txtname.Value ws.Cells(iRow, 2).Value = Me.txtid.Value ws.Cells(iRow, 3).Value = IIf(Val(Mid(Me.txtid.Value, 3, 3)) > 500, "Female", "Male") ws.Cells(iRow, 4).Value = Left(Me.txtid.Value, 2) + 1900 ws.Cells(iRow, 5).Value = IIf(Val(Mid(Me.txtid.Value, 3, 3)) > 500, Val(Mid(Me.txtid.Value, 3, 3)) - 500, Val(Mid(Me.txtid.Value, 3, 3))) 'clear the data Me.txtname.Value = "" Me.txtid.Value = "" Me.txtname.SetFocus End Sub Private Sub cmdExit_Click() x = MsgBox("Are you sure you want to exit", vbYesNo, "Sure") If x = vbYes Then Unload Me End If End Sub [B]Any Way nice Code........ Thanks......[/B] [/QUOTE]
Insert quotes…
Verification
Hathara warak wissa keeyada? (Hathara wadi karanna 20)
Post reply
Top
Bottom