Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. StewartGW

    Trouble with List Boxes

    Unless there is some specific reason you are using an ADO component I suggest the following that will do the same thing: 'Declaration Private cn As ADODB.Connection Private rs as ADODB.Recordset Private strSQL as String Private Const CONNECTION_STRING = _...
  2. StewartGW

    Text Box formating question

    Set the Text Align property of the text box to Right. The SQL command statement does not care if the value is ' 2' or '2'.
  3. StewartGW

    Calling sub or module to bind txt boxes on frmMain to ADO Recordset

    Currently as written, the procedures called by secondary form, can only be seen by the frmMain. To call these functions, you must first identify the form object and the VB Intellisense will show you these methods. The code should for the second form should like the following: Sub cmdOK_Click()...
  4. StewartGW

    ListIndex = -1

    I don't know what your code looks like but here's an example of what you could do. The example below assigns the ListIndex property of the List control to the ListIndex property of the Combo box control in the OnClick event of the List control. To access the data I use the List property to...
  5. StewartGW

    Is it possible to put a TAB chr() in a string expression?

    Use the VB constant, vbTab, in order to include a tag in a concantenated string. Example: strData = 'The temperature is : " & vbTab & "65 degrees"
  6. StewartGW

    How to create a custom auto-incremented number

    Create a function that gets the max value of the primary key using a SQL statement as follows: Set rs = cn.Execute("SELECT MAX(pk_key) + 1 FROM TableName") If Not rs.EOF Then strPK_KEY = Right(CStr(Year(Date()),2) & "-001" Else strPK_KEY = rs(0) End If
  7. StewartGW

    Order of events

    You need to exit the procedure, i.e., Exit Sub. If the procedure is a funtion, then Exit Function. If Isnull(Me!DOB) Then MsgBox "Date of Birth cannot be null. Please enter.", vbOKOnly Me!DOB.SetFocus Exit Sub End If
  8. StewartGW

    SQL Help

    Actually, you can export the data out as an Excel file.
  9. StewartGW

    why does not this program work?

    Should be: If strAnswer = vbYes Then GoTo Err_Denominator: Not If strAnswer = vbYes Then Err_Denominator: Err_Demonitor is an error label not a subroutine.
  10. StewartGW

    HI, I was trying to connect VB6.0

    What does your connection string look like?
  11. StewartGW

    Need a multi-column combo box to display text and hidden id

    CORRECT COPY: The ComboBox control on the VB IDE Toolbar has an ItemData property which lets you associate a 32-bit integer value with each item loaded in the ComboBox control. You could store the Inventory ID here and reference it from the ItemData property as needed. If Not rs.EOF Do...
  12. StewartGW

    Need a multi-column combo box to display text and hidden id

    The ComboBox control on the VB IDE Toolbar has an ItemData property which lets you associate a 32-bit integer value with each item loaded in the ComboBox control. You could store the Inventory ID here and reference it from the ItemData property as needed. If Not rs.EOF Do While Not rs.EOF()...
  13. StewartGW

    Please help with a stored procedure

    Sorry, I may have confused you. You can pass through as many months as you want; it is depended upon your case statement. The statement "The solution uses a CASE statement, that makes only a single pass through the table." was provided to let you know this the solution is much more...
  14. StewartGW

    Stored Procedure

    Balves, I am assuming that he wants to move ALL the data from an existing database to another existing database. Perhaps there is another way besides a cursor to move all the data. Of course if he is just moving a record then it would hold true that a cursor is not needed. Gary
  15. StewartGW

    Stored Procedure

    Use a cursor to accomplish this task. The values in the brackets are replaceable values as well as the variables. Keywords are capitalize CREATE PROCEDURE [sp_name] AS 'Declare variables DECLARE @var1 char(1), @var2 int 'Define the cursor DECLARE [cursor_name] CURSOR FOR SELECT var1...
  16. StewartGW

    Please help with a stored procedure

    This is an example of using a pivot table or cross-tabs. Suppose you have a simple table called dev_cross_tab with the following datga: Developer Mgr Agt Mon Value ------- ---- ---- ----- ----- MICHELLE Anne Josh Aug00 1 MICHELLE Anne Josh Sep00 1 MICHELLE Anne Josh...
  17. StewartGW

    assigning values

    This cannot be done because the Textbox is an Object data type. VB uses object variables to store reference objects. The way to deal with object varialbes is that you assign object references to them using the Set key word, as in the following code: 'Variables can be declare as an Object or...
  18. StewartGW

    How do I enumerate through selected records?

    Recommend you store the primary keys or unique values of the selected items in an array. Next, iterate through the array using the rs.Find or rs.Filter method to isolate your record, then call the rs.Delete command. 'Assume rs is a current Recordset object that contains 'data Sub Delete()...
  19. StewartGW

    Access EXTREMELY slow on network [not responding]

    Recommend you split your database application and place the database on the backend the objects on the front end. The most common reason to split a database is that you are sharing the database with multiple users on a network. If you simply store the database on a network share, when your...
  20. StewartGW

    Another text file question?

    You must always take errors into account during read/write operations. A better way is use the LOF function to determine the length of a file and read all characters in one operation with the Input$ function. Thereafter, use the Split string function to place the contents into an array and...

Part and Inventory Search

Back
Top