Paulsburbon
Registered User.
- Local time
- Today, 12:29
- Joined
- May 3, 2005
- Messages
- 65
Hello, I need a second bite at the apple here, I've got the following code that opens a webpage that is google and searches and works well but I still need some help messing with it. I would like the browser to open in the current window. Right now it opens in a new tab. Also if I could get the inputbox to stay on top while I look on the webpage that would be great and make it easier for me to type in the value. Then I need some code to close the browser.
The whole thing does have an empty msgbox that comes up at the end.
Private Sub Command88_Click()
On Error GoTo Err_Command88_Click
Dim strInput As String
Dim ibMessage, ibTitle, ibDefault As String
Dim ibValue As Variant
Dim ibShowBox As Boolean
Dim rsib As New ADODB.Recordset
Dim ibSQL As String
Dim ibRunGoogle As VbMsgBoxResult
Dim ibLineItemText As Variant
ibRunGoogle = MsgBox("Get prices from Google?", vbQuestion + vbYesNo, "Get Prices")
If ibRunGoogle = vbYes Then
ibSQL = "SELECT chrLostItemDescription,curRetail " & _
"FROM tblClaimLineItems " & _
"WHERE tblClaimLineItems.[lngClaimNumber] = '" & Me.TXTClaimNumber & "'" & _
"ORDER BY idsLineItemID;"
rsib.Open ibSQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rsib.MoveFirst
Do Until rsib.EOF
If rsib!curRetail = 0 Then
ibLineItemText = chrLostItemDescription
strInput = "http://images.google.com/search?q=" & Me!chrLostItemDescription & " Price"
Application.FollowHyperlink strInput, , False
ibMessage = " Enter Price From Google "
ibTitle = " Enter Value For " & Me!chrLostItemDescription
ibDefault = ""
ibShowBox = True
While ibShowBox = True
ibValue = InputBox(ibMessage, ibTitle, ibDefault, 0, 0)
If ibValue = "" Then
ibShowBox = False
Else
If IsNumeric(ibValue) = True Then
rsib!curRetail = ibValue
MsgBox "Value Has been updated"
ibShowBox = False
Else
MsgBox "Please enter numbers only"
End If
End If
Wend
End If
rsib.MoveNext
Loop
End If
Err_Command88_Click:
MsgBox Err.Description
Exit Sub
End Sub
Paul
The whole thing does have an empty msgbox that comes up at the end.
Private Sub Command88_Click()
On Error GoTo Err_Command88_Click
Dim strInput As String
Dim ibMessage, ibTitle, ibDefault As String
Dim ibValue As Variant
Dim ibShowBox As Boolean
Dim rsib As New ADODB.Recordset
Dim ibSQL As String
Dim ibRunGoogle As VbMsgBoxResult
Dim ibLineItemText As Variant
ibRunGoogle = MsgBox("Get prices from Google?", vbQuestion + vbYesNo, "Get Prices")
If ibRunGoogle = vbYes Then
ibSQL = "SELECT chrLostItemDescription,curRetail " & _
"FROM tblClaimLineItems " & _
"WHERE tblClaimLineItems.[lngClaimNumber] = '" & Me.TXTClaimNumber & "'" & _
"ORDER BY idsLineItemID;"
rsib.Open ibSQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rsib.MoveFirst
Do Until rsib.EOF
If rsib!curRetail = 0 Then
ibLineItemText = chrLostItemDescription
strInput = "http://images.google.com/search?q=" & Me!chrLostItemDescription & " Price"
Application.FollowHyperlink strInput, , False
ibMessage = " Enter Price From Google "
ibTitle = " Enter Value For " & Me!chrLostItemDescription
ibDefault = ""
ibShowBox = True
While ibShowBox = True
ibValue = InputBox(ibMessage, ibTitle, ibDefault, 0, 0)
If ibValue = "" Then
ibShowBox = False
Else
If IsNumeric(ibValue) = True Then
rsib!curRetail = ibValue
MsgBox "Value Has been updated"
ibShowBox = False
Else
MsgBox "Please enter numbers only"
End If
End If
Wend
End If
rsib.MoveNext
Loop
End If
Err_Command88_Click:
MsgBox Err.Description
Exit Sub
End Sub
Paul