VB Code for button for Access 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form called "Quote Entry" displaying data from a table called
"Quote" with a field "CustomerID", on this form there is a button called
"Customers". This opens a form called "Customer Display" which is a
Continuous list of customers, from the current selected customer record. I
need some code for a button on the "Customer Display" form to save the
current CustomerID back the Quote Entry form and add it to the Quote Table
 
Meaty said:
I have a form called "Quote Entry" displaying data from a table called
"Quote" with a field "CustomerID", on this form there is a button called
"Customers". This opens a form called "Customer Display" which is a
Continuous list of customers, from the current selected customer record. I
need some code for a button on the "Customer Display" form to save the
current CustomerID back the Quote Entry form and add it to the Quote Table

With Forms![Quote Entry]
![CustomerID] = Me![CustomerID]
.Dirty = False
End With
 
Stuart

Thanks, works well

I have a another problem, the "Quote Entry" form has a second button which
opens a "Project File" form which lists a continuous list of the existing
quotes, from the current selected quote. I need some code for a button on
the "Project File" form to make that selected quote the currently displayed
quote on the "Quote Entry" form.
--
thank you for your help


Stuart McCall said:
Meaty said:
I have a form called "Quote Entry" displaying data from a table called
"Quote" with a field "CustomerID", on this form there is a button called
"Customers". This opens a form called "Customer Display" which is a
Continuous list of customers, from the current selected customer record. I
need some code for a button on the "Customer Display" form to save the
current CustomerID back the Quote Entry form and add it to the Quote Table

With Forms![Quote Entry]
![CustomerID] = Me![CustomerID]
.Dirty = False
End With
 
Meaty said:
Stuart

Thanks, works well

I have a another problem, the "Quote Entry" form has a second button which
opens a "Project File" form which lists a continuous list of the existing
quotes, from the current selected quote. I need some code for a button on
the "Project File" form to make that selected quote the currently
displayed
quote on the "Quote Entry" form.

First we need to clear up a little ambiguity.

Do you mean you want the "Quote Entry" form to set focus to the currently
selected quote on the "Project File" form, or for the "Project File" form to
set focus to the selected quote on the "Quote Entry" form?

Or have I misunderstood altogether? (Wouldn't be the first time!)
 
Stuart

"Project File" form to set QuoteID focus to quoteID on the "Quote Entry"
form. The "Quote Entry" to display QuoteID from the "Project File" Form.
 
Meaty said:
Stuart

"Project File" form to set QuoteID focus to quoteID on the "Quote Entry"
form. The "Quote Entry" to display QuoteID from the "Project File" Form.

Gotcha. This'll have to be air code - I'm unable to test at the moment.

Code for your button on the "Project File" form:

Dim rs As DAO.Recordset

With Forms![Quote Entry].Form
Set rs = .Recordsetclone
rs.FindFirst "QuoteID = " & Me.QuoteID
If Not rs.NoMatch Then
.Bookmark = rs.Bookmark
End If
End With
rs.Close
Set rs = Nothing
 
Back
Top