gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
I have a Split form which has a search query box (Text711)
If the results come up blank I want the user to be able to click a button to add a new record but I also want to take the data in TExt711. that ended in a null search, and add it so the user doesn't have to retype it.
The field to add it to is BidItem_Number
Is this possible?
The record source is: SELECT tblBidItemData.*, tblBidItemData.BidItem_Number FROM tblBidItemData WHERE (((tblBidItemData.BidItem_Number) Like [forms]![frmBidItems]![Text711] & "*")) ORDER BY tblBidItemData.BidItem_Number;
Code:
Private Sub Text711_Change()
Me.Requery
Me.Text711.SetFocus
End Sub
If the results come up blank I want the user to be able to click a button to add a new record but I also want to take the data in TExt711. that ended in a null search, and add it so the user doesn't have to retype it.
Code:
Private Sub Command87_Click()
On Error GoTo Command87_Click_Err
On Error Resume Next
DoCmd.GoToRecord , "", acNewRec
If (MacroError <> 0) Then
Beep
MsgBox MacroError.description, vbOKOnly, ""
End If
Command87_Click_Exit:
Exit Sub
Command19_Click_Err:
MsgBox Error$
Resume Command87_Click_Exit
'Take the data entered in Text711 and add it to BidItem_Number as the data for the new record
End Sub
The field to add it to is BidItem_Number
Is this possible?
The record source is: SELECT tblBidItemData.*, tblBidItemData.BidItem_Number FROM tblBidItemData WHERE (((tblBidItemData.BidItem_Number) Like [forms]![frmBidItems]![Text711] & "*")) ORDER BY tblBidItemData.BidItem_Number;