-
#1. How do you make a text box auto scroll once the text has gone beneath it's watermark?
#2. How do I make text go to the next line like a BR in HTML? IE: text1.text = text1.text + <linebreak> + text2.text...
#3. How do I access a Access Database using VB?
Thanks for any help you guys can offer, sorry for the foolish questions but I'm new to VBing :) *grumble, grumble, where's C++ when you're familiar with it*
-
Q1:
Code:
Private Sub Command1_Click()
Text1.SelStart = Len(Text1)
End Sub
Q2:
Code:
Text1.text = "<html>" & Chr$(13) & Chr$(10) & "</html>"
-
Not sure if this is what you need for the line break...
Line breaks cannot be entered in the Properties window at design time. Within a procedure, you create a line break by inserting a carriage return followed by a linefeed (ANSI characters 13 and 10). You can also use the constant vbCrLf to insert a carriage return/linefeed combination. For example, the following event procedure puts two lines of text into a multiple-line text box (Text1) when the form is loaded:
Sub Form_Load ()
Text1.Text = "Here are two lines" _
& vbCrLf & "in a text box"
End Sub
-
Thanks
Yeah, what I meant was VB's equivelant to the line break of HTML... sorry if I didn't make that clear. vbCrLf was what I was looking for though. Thank you both.
-
Opening Access is like opening any other Application using its exposed Object Model
Try this:
Dim accApp As Access.Application
Set accApp = CreateObject("Access.Application")
Remember to create a Reference in your Project to MSAccess, to allow early binding.
Then you can use the Access Object Model in your project by creating instances of TableDefs, Recordsets etc....
For More Information See "CreateObject Function."