Skip to main content

Posts

generate auto ID number

This code will generate auto id number for the unique id. Public Sub id() Dim lastnumber As Long, newnumber As Long 'Check if there are records in the file With recordset If .BOF = True And .EOF = True Then lastnumber = (any number) Else .MoveLast lastnumber = !field in recordset End If 'Generate New Number newnumber = lastnumber + 1 Text1.Text = newnumber End With End Sub please comment if this post helps you.....

Control Multiple option button

Now if we have multiple option button on one form then how to control all of them. If we need to add lots of option button on one form then they all will communicate with each other Means at run time only one option button can be checked. So the solution to this is to add frames on form and apply option button in frame to group option buttons. any option button out of frame can't communicate with option button inside the frame. Please comment if this post help you....

Load combobox with items from database

The given code will help to get database value in your combobox. public con as new adodb.connection public rs as new adodb.recordset rs.Open "Select (data field to load in combobox) from (tablename) ", con, adOpenForwardOnly, adLockReadOnly While rs.EOF = False Combo1.AddItem rs!(data field to load in combobox) rs.MoveNext Wend