VB Code for button for Access 2003

M

Meaty

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
 
S

Stuart McCall

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
 
M

Meaty

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
 
S

Stuart McCall

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!)
 
M

Meaty

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.
 
S

Stuart McCall

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top