There are times when you need to make sure your counter starts at an odd or even number. Even is pretty simple - `counter = counter + modulus(counter)`. If counter is even it stays, if it's odd it gets incremented by 1. Odd is a bit more complicated - `counter = counter + modulus(counter + 1)`, If counter is odd it stays, if it's even it gets incremented by 1. if you're in danger of counter being the max value you can always subtract instead. These basic algorithms should work for any language that has a modulus operator/function. I've included …

Member Avatar
Member Avatar
+2 forum 4

Private Sub delBtn_Click() rs.Open Dim list As ListItem Set list = ListView1.ListItems.Add(, CStr(rs!Project_Name)) confirm = MsgBox("Do you want to delete the Employee Record", vbYesNo + vbCritical, "Deletion Confirmation") If confirm = vbYes Then ListView1.ListItems.Remove ListView1.SelectedItem.Key 'this line gives error Dim CM As ADODB.Command Set CM = New ADODB.Command Set CM.ActiveConnection = con CM.CommandType = adCmdText CM.CommandText = "DELETE FROM bmsTable WHERE Project_Name= ?" CM.Parameters.Append CM.CreateParameter("@Name", adVarChar, adParamInput, 50, ListView1.SelectedItem.Key) CM.Execute , , adExecuteNoRecords MsgBox "Record successfully deleted..", vbInformation, "Success" End If End Sub

Member Avatar
Member Avatar
+0 forum 1

hi.. am unable to view objects of a form in a project, although am able to view its code.. Whenever i try to open the form to view its objects, i rcv an error mentioning **"Error Loading Form. Please check "<path>.log" for details."** In the log file it says **"Line 59: Property Picture in cmdSelect could not be set."** How could i check the property of a command button without opening the form..?? Plz help..

Member Avatar
Member Avatar
+0 forum 14

Hi guys, this is my first question here What useful plug-ins / debuggers for Visual Studio do you use (for Windows)? P.S. I know Visual Studio has a good debugger. Thanks a lot

Member Avatar
Member Avatar
+0 forum 3

i am install visual studio some IIs express error can occured please help me solve this error..

Member Avatar
Member Avatar
+0 forum 1

I'm trying to connect a database with a login form to verify user as an existing one or a new one to sign up Private Sub Command1_Click() Adodc1.RecordSource = "select *from newcustomer where firstname='" + Text1.Text + "' and surname='" + Text2.Text + "' and customerid='" + Text3.Text + "' and phone='" + Text4.Text + "' and yearofbirth='" + Text5.Text + "' and emailaddress='" + Text6.Text + "' and username='" + Text7.Text + "' and password='" + Text8.Text + "' " Adodc1.Refresh If Adodc1.Recordset.EOF Then MsgBox "INVALID USERNAME/PASSWORD" Else Form4.Show End If End Sub Private Sub Command2_Click() Adodc1.Recordset.Update End Sub …

Member Avatar
Member Avatar
+0 forum 4

Hi guys, im a newbie in programming, please i need help in populating ms datagrid from ms sql table, can anyone suggest me something thnx

Member Avatar
Member Avatar
+0 forum 1

hi...can someone help me?? a program that i can print barcode from a vb6 application? once i entered data, (i have already a format for the barcode value), it will print the barcode once.. then, enter again info, then print.. i have a sato barcode printer ct400.is there any configuration in the printer or i just need code???? thanks..

Member Avatar
Member Avatar
+0 forum 5

Option Explicit Dim cn As New ADODB.Connection Dim rs As New ADODB.Recordset Dim list As ListItem Sub Connection() cn.Open "provider=microsoft.jet.oledb.4.0;data source=C:\Users\Archana\Documents\login.mdb;" rs.CursorLocation = adUseClient rs.Open "ARegistration", cn, adOpenKeyset, adLockPessimistic End Sub Private Sub cboAid_Click() rs.Open "Select * from ARegistration", cn, adOpenDynamic, adLockOptimistic rs.MoveFirst Do While Not rs.EOF If cboAid.Text = rs.Fields(0) Then txtAname.Text = rs(1) cboState.Text = rs(2) cboCity = rs(3) txtPincode = rs(4) txtAddress = rs(5) txtPhoneno = rs(6) DTPicker1 = rs(7) cboGender = rs(8) cboQualification = rs(9) Exit Sub rs.Close End If rs.MoveNext Loop End Sub Private Sub cboState_Click() cboCity.Clear If cboState.Text = "Tamilnadu" Then cboCity.AddItem "Madurai" cboCity.AddItem …

Member Avatar
Member Avatar
+0 forum 2

KINDLY I NEED HELP I WANT TO LEARN VISUAL BASIC PROGRAMMING IF ANY ONE HELP HOW HIGHLY APPLICIATES THANKS.

Member Avatar
Member Avatar
-1 forum 1

I'm very new to visual basic 6.0 and I have a very less knowledge in it. My project is about airport boarding pass generator. In my first form,I have a text box for entering PNR by the user. Here, the program has to search for the PNR already stored in a ADODB connected MS access database. IF the PNR entered by the user is right, then it has to go to the next form showing entire details of the passenger and flight, otherwise it should pop up a msg. box saying "invalid PNR". here is the coding i used: Dim …

Member Avatar
Member Avatar
+0 forum 2

I have a text file with the following contents: Andrew Law 32 6'1 123 Pounds Tom Harris 19 5'5 180 Pounds Randy Poffo 45 5'3 141 Pounds Now on my form i have a listbox and four labels. What i would like to do is have the listbox show only the names of the people in the text file (Andrew Law, Tom Harris, Randy Poffo) and when the user clicks the persons name in the listbox i would like each of the labels to show the corresponding details for that person (one label showing age, one showing their height and …

Member Avatar
Member Avatar
+0 forum 2

I am writing an application which will process data over night. When it's finished a report is printed out. I am wanting the report to be printed to 3 different printers on the same network. Is it possible to do this? All three printers are installed on the pc. Thanks in advance PG

Member Avatar
Member Avatar
+0 forum 3

Hello all, I am relatively new to Visual Basic and have managed to muttle my way through creating a 2013 Word document that has some ActiveX controls. The final control I put in place is a Command Button that, when clicked, it sends the form off to an email. That is all working great, however, I would like to have a pop-up message that displays after the button is clicked, letting the form sender know the form has actually been sent. I have put the code I used for this Command Button below. Any help would be much appreciated. Private …

Member Avatar
Member Avatar
+0 forum 9

Can anyone help me to create a code to count how many words that are greater than 6? I am creating a readability test to calculate number of words etc. from three differente txt files. This is from my third and last private function. All help appreciated big time! :) I have translated some of the words in the coding to make it easier to understand what it does... Option Compare Database Option Explicit Private Const ordDeler As String = ",:;.!?" `Private Function findLongWords(ByVal bok As String) As Double Dim tegn As String, fil As String, linje As String Dim …

Member Avatar
Member Avatar
+0 forum 2

Hi, Front end Vb6, back end.. access... connection.. ODADB... can someone please help me with the code for login and password.

Member Avatar
Member Avatar
-6 forum 15

i somehow got the gist of adding items and filtering the already inputted ones but i cant seem to know how to start a loop where the code searches for similar items in the listbox before adding new items. when trying to run my code, it does filter out the similar items yet it still add info/items in the listbox. below is a a part of my code. If counter = 1 Then lstboxProd.Items.Add(cmbBoxSel.Text) lstboxPrice.Items.Add(txtPrice.Text) lstboxQty.Items.Add(txtQuant.Text) lstboxTotal.Items.Add(txtPrice.Text * txtQuant.Text) counter = counter - 1 Else For index As Integer = 0 To lstboxProd.Items.Count - 1 If cmbBoxSel.Text = lstboxProd.Items.Item(index) Then …

Member Avatar
Member Avatar
+0 forum 1

Ok I have a workbook that have 5 worksheets for a 5 year span. On each of the worksheets are there is a list of countries that make up the combobox (which works perfectly). On my userform I have a frame on the userform that represent each worksheet. **My problem is that I can't get the textboxes to populate based on the combobox selection. If that country is on three of the sheets I need for it to populate according to the year.** This code works perfectly with the exception of populating my label boxes with line one starting with …

Member Avatar
Member Avatar
+0 forum 6

I am a drafter using autocad and I know a littttttle bit of VB6. We just happen to have it installed on our computers and I wanted to create an application that can do this: 1. Takes the # input from text1 and text2 and waits for the user to hit "Ok" (command click) 2. Upon clicking, the information from Text2 gets multiplied by 0.75, and the total sum is then compared to Text1 with a less than or equals to equation. 3. the comparison then Decides if the sendkeys will say "G152B" or "CB152B" to Notepad Without words i …

Member Avatar
Member Avatar
+0 forum 2

I am working on the workshop selector in Visual Basics 7th Edition chapter 5 and I just can't get the calculate total button to work after trying numerous different codes. Here is the criteria for the program. 3 list boxes, 4 buttons, 2 labels. The application allows the user to select a workshop from lstWorkshop, Then select a location from lstLocation. Next btnAdd takes the selected workshop and location attached to a set amount of days and a registration fee and multiplies the days by a Lodging fee and outputs this number in dollar form. After multiple workshops/locations have been …

Member Avatar
Member Avatar
+0 forum 1

How we can a make a setup file in vb6 as other software need to install ( Like need a product key to Install )

Member Avatar
Member Avatar
+0 forum 5

Hi, I run a VB6 programm that open Excel.xlsm I close the VB6 programm Excel.xlsm is always open I run a VB6 programm How can I work on the already ope n Excel.xlsm and not open an other Excel.xlsm? My OS = Windows 10 Thanks in advance for your help Jean-Claude

Member Avatar
Member Avatar
+0 forum 5

I have an Epson receipt printer (Model number: TM-T88V), but I cannot use it. I do not have a POS (point of sale) software that will let me do what I need to do, nor do I have the knowledge I need to understand the developers guide manual that comes with the printer. Seen here: (https://files.support.epson.com/pdf/pos/bulk/epos-print_xml_um_en_revk.pdf) I want to make a receipt that looks identical to a competitor company, but with my own information; e.g. different items, prices, and logo. I have the same exact printer as them, and they use the printers default font. This font however is built …

Member Avatar
Member Avatar
+0 forum 3

Hi, I have one doubt. I did creat a new software from vb 6.0. Database management system. I am using MS access database. that is saved and connectivity in my C drive. And I did out put the exe file. What i need na, i did install this software one of my computer and another one computer ( 2 systems). But when i am use that software from 2nd computer then the data need to save first computer(But i am using Access database connection path is my first computer). how can i solve this. pls help

Member Avatar
Member Avatar
+0 forum 3

Private Sub btn_addc_Click() On Error Resume Next If Me.txtAddc.Text = "" Then MsgBox "Please fill up", vbInformation, "ADD CATEGORY" Exit Sub End If If Me.btn_addc.Caption = "ADD" Then If rs.State = adStateOpen Then rs.Close rs.Open " Select * From tbl_category WHERE CategoryList ", db, adOpenStatic, adLockOptimistic If rs.RecordCount > 0 Then MsgBox "The Category you have entered is already Existed", vbCritical, "Error" btn_refresh_Click Me.txtAddc.Text = "" Me.txtAddc.SetFocus Else With rs .AddNew .Fields("CategoryList") = Me.cmb_addc.Text .Update End With MsgBox " Category Successfully Added.", vbInformation, "CATEGORY" btn_refresh_Click End If End If End Sub

Member Avatar
Member Avatar
+0 forum 7

Hi, I got a project to load a pdf into a picturebox in vb6. How do I handle that? Is there anyone who sell that .ocx? is there anyway to do it? Thanks

Member Avatar
Member Avatar
+0 forum 12

Dim Values As Range Dim CurrentSheet As Worksheet Set CurrentSheet = ActiveWorkbook.ActiveSheet Set Values = Rows(5) For j = 0 To 20 For i = 1 To Values.Cells.Count - 1 Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _ Formula1:="=Delimit2!$A$" & i, Formula2:="=Delimit2!$B$" & i Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority With Selection.FormatConditions(1).Font Color = -16383844 TintAndShade = 0 End With With Selection.FormatConditions(1).Interior PatternColorIndex = xlAutomatic Color = 13551615 intAndShade = 0 End With Next i Next j In this I code, I would like to increment column A to C and B to D after For loop of i gets over.

Member Avatar
+0 forum 0

Hi all.. How i can make a report without using database. Data can directly from the active form. Thank you in advance

Member Avatar
Member Avatar
+0 forum 6

Hi, I need to convert a binary notepad file into a text (readable) file using VBA. Is this possible with just using VBA code? If so what would that code be? Thanks

Member Avatar
Member Avatar
+0 forum 1

Hi Folks, This is Raghuveer I am very new to the vb programming I need to display the data in flex grid.Please give me the guidence

Member Avatar
Member Avatar
+0 forum 1

The End.