'Pushpin'-style control

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

Guest

Greetings all!

After spending several long, frustrating hours perusing these discussion groups, I thought I'd break down and ask:

I need to find a way to insert (or build) a pushpin-type control onto one of my forms. It's a toggle-style control that retains data (on demand) in a field from one record to the next. I've seen it done in various database-based programs, and I'm immensely frustrated by the fact that Access 2003 just doesn't seem to have that capability. Maybe I've managed to overlook it, but could someone please help me out?

Many thanks in advance.
 
GP,

Well, there's a control called a Toggle Button, which can be bound to
a field with Yes/No data type. Would that suit your purpose?

- Steve Schapel, Microsoft Access MVP
 
Steve

The toggle control probably would be OK, if I could figure out how to make it carry over data in the field from one record to the next

Any help at all would be appreciated

Thanks again.
 
GP,

The same way you do with any data control... set the Control Source
property of the control to the name of the field in your table that
you want the data to be recorded in. The Toggle Button will most
likely be related to a field in your tagle with a Yes/No data type...
is this what we are talking about?

- Steve Schapel, Microsoft Access MVP
 
Steve

Perhaps a bit more explanation on my part is in order. I'm making a simple database which will be used to track serial numbers of inventory. I want my users to be able to click on a control which will enable the data in a field (for instance, SupplierID, PartNumber, Manufacturer, etc.) to carry over into a new record, rather than having to retype data into ALL the fields. The user could then click the control again when (s)he wanted to change the data for the new record. All the data involved would be alphanumeric, not yes/no. I also don't think a default value would work for the data fields, simply because if the data entered was different from the default values, it would be exactly the same as if the fields were blank

Such a feature would be a tremendous time-saver, if only for the reason that the records entered in a day could easily number in the hundreds

Cheers
 
GP,

Well, I thought I knew what you were talking about, but obviously I
was way off the mark, and now I'm not at all sure :-)

But this might help... There is a shortcut key combination of Ctrl+'
(i.e. apostrophe) which will automatically enter into a field the same
value as entered in same field in the previous record.

Other than that, you might need to write some VBA procedures to do
what you want. For example, something like this... on the
double-click event of the relevant data controls on the form:
Dim strForNew As String
strForNew = Me.PartNumber
DoCmd.GoToRecord , , acNewRec
Me.PartNumber = strForNew

Then, if you want to enter a new record with the same part number as
one in an existing record, double-click on the PartNumber in the
existing record and automatically entered in the new one. Is this
relevant?

Then, would a part number automatically tell you who the Manufacturer
is? Or would there be instances where a given part number could be
from more than one manufacturer? Or SupplierID? It seems to me that
the data entered should be based on an applicable query which will
fill in related fields for you anyway, if indeed the fields are
related :-)

- Steve Schapel, Microsoft Access MVP
 
Steve:

The Ctrl-apostrophe shortcut sounds like it might do the trick. Is there any way to code this behaviour onto a toggle button, for instance? I ask merely because I'm abysmally new to Access.

Thanks for your prompt replies!
 
GP,

There are many ways that this could be done in code, variations on a
theme. For example, you could put something like this on the
double-click event of each of the relevant textboxes on the form...

If IsNull(Me.MyField) Then
Me.MyField = Me.Tag
Else
Me.Tag = Me.MyField
End If

So, to transfer the value from a field in an existing record to the
same field in a new record, just double-click first on the existing
one, and then on the new one.

- Steve Schapel, Microsoft Access MVP
 
Back
Top