microsoft.public.access.formscoding
  Home FAQ Contact Sign in
microsoft.public.access.formscoding only
 
Advanced search
January 2008
motuwethfrsasuw
 123456 1
78910111213 2
14151617181920 3
21222324252627 4
28293031    5
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
microsoft ... formscoding Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Re: OpenReport where condition with openargs         


Author: Allen Browne
Date: Jan 31, 2008 18:16

This is a bug that's fixed in Access 2007.

Previous versions of Access never maintained the Filter/FilterOn properties
of the report correctly. Other examples here:
Incorrect filtering
at:
http://allenbrowne.com/bug-02.html

If you can't switch to A2007, you may be able to work around the issue by
setting public variables.

Not sure exactly what you are doing, but I always call my own
OpenTheReport() function instead of OpenReport:
http://allenbrowne.com/AppPrintMgtCode.html#OpenTheReport

It addresses several issues, e.g.:
- setting a return value rather than generaing errors if the report doesn't
open,
- closing the report if already open so the filter is applied correctly,
- setting one of the user's specific printer if required, and
- passing a user-readable description of the filter in OpenArgs.
Show full article (2.59Kb)
no comments
  Re: help with Where clause         


Author: Walter
Date: Jan 31, 2008 17:13

"Dirk Goldgar" wrote:
> "Walter" discussions.microsoft.com> wrote in message
> news:682FDE79-3221-46F2-9105-316E5C6C1E3B@microsoft.com...
>> Please tell me what's wrong with the Where clause in this SQL. This is...
Show full article (2.79Kb)
4 Comments
  Can't get my head around a requery         


Author: Opal
Date: Jan 31, 2008 16:56

I have done this in the past without an issue, but can't seem to
get it to work on this particular database and I can't figure out
why.

I am running Access 2003. I have a form (frmConcern) bound
to a table - Concern. In the Form I have combo box (cboRank).
When the user selects a "rank" option (A, B or C) I want to
auto fill a txtRankDescription text box. I am using a hidden
subform bound to the Rank table to auto fill this text box.
The control source for the txtRankDescription is:
=subfrmRank.Form!Description

I have added the following code:

Private Sub cboRank_AfterUpdate()
Forms![frmConcern].[subfrmRank].Requery
End Sub

but if the user wishes to change the rank (from B to A, for example)
the subform does not re-query.
Show full article (0.99Kb)
5 Comments
  Any reason CurrentDb.TableDefs(0).Connect returns empty sting in Access 2007?         


Author: GollyJer
Date: Jan 31, 2008 15:30

I use the function below to return the server or database name for various
uses.
However, now that we've switched to 2007 the line
CurrentDb.TableDefs(0).Connect
which used to return the connection string is returning an empty string.

Any ideas?

Thanks,
Jeremy

Function GetConnectionProperty(ServerOrDatabase As String) As String
' Returns name of connected server if "Server" passed in.
' Retuns name of connected Database if "Database" passed in.
Dim sConnectionString As String
Dim aConnectionPieces() As String
Dim sConnectionPiece As String
Dim i As Long

On Error Resume Next

sConnectionString = CurrentDb.TableDefs(0).Connect
aConnectionPieces = Split(sConnectionString, ";")
Show full article (1.24Kb)
2 Comments
  Filter by Form limitations         


Author: Angela
Date: Jan 31, 2008 15:29

I have a form with several combo boxes which are "limit to list". I have
another combo box that is disabled if the value in another field doesn't meet
certain criteria. When the user clicks "filter by form", they can't enter
any wildcard strings into the "limit to list" combo boxes, and they can't use
the disabled field at all for filtering.

I would like the form to become more usable for filtering when the user
clicks "filter by form" (ability to use wildcards etc). What is the best way
to do this? I had a thought that I could put a procedure in the ApplyFilter
event that checks to see if the filter being used is 'filter by form', and
then changes these combo boxes so that they are more usable (enable them and
set LimitToList to false). I don't want the fields to be accidentally left
in this state, however.

Has anyone tried this or is there a more straightforward way to accomplish it?

Thanks
Angela
4 Comments
  Help - corrupted file         


Author: mscertified
Date: Jan 31, 2008 14:48

I have been working on this Access DB since early this morning and now
somehow the file has become corrupted. I cannot run a compact and repair. I
ran Jetcomp and it created a new file but the corruption is still there. I
cannot export or import the modules to a new database. I have a backup but it
ran several hours ago and I've made lots of changes since then. It will take
me hours to recreate the changes. I've mainly been changing a form and a
report. I can see both in design view but cannot get to the code which is
what I need to do a cut and paste. Is there any way to display the code so at
least I can copy the changed sections?????
5 Comments
  Data Validation date field         


Author: Jonathan Brown
Date: Jan 31, 2008 14:38

I don't understand why this isn't working. I just want to make sure that
they don't put a future date in the polydate field. Is me.polydate > now()
an invalid expression?

code:
_________________________________________________________
Private Sub Form_BeforeInsert(Cancel As Integer)

If Me.PolyDate > Now() Then
Cancel = True
Me.PolyDate.SetFocus
MsgBox "Please enter a date that falls prior to today's date"
Exit Sub
End If

End Sub
8 Comments
  Program error         


Author: Jimmy
Date: Jan 31, 2008 14:25

I am trying to append the data to an excel file . It worked while running
access 2000 but now that it is
running in access 2003 it no longer works. rsExcel.AddNew is where it
continues to blow up and I was wondering if there might be a work around or
maybe just a compatibility issue.

cnExcel.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\TEST.xls;
Extended Properties=""Excel 8.0;HDR=YES""", "", ""
rsExcel.Open "Select * from TABLE", cnExcel, adOpenDynamic,
adLockOptimistic

While Not rs.EOF
rsExcel.AddNew
rsExcel.Fields(0).Value = rs.Fields("Col_1")
rsExcel.Update
DoEvents
rs.MoveNext
loop
5 Comments
  Open the form with 2nd tab focused instead of 1st tab         


Author: Song Su
Date: Jan 31, 2008 14:23

Access 2003

I have a button on a form to open another form with 2 tabs.

What's the code to open a form with 2nd tab focused instead of default 1st
tab?
4 Comments
  Limiting fields         


Author:
Date: Jan 31, 2008 13:43

I have a form with two fields: Department and ResponsibleParty. This form is
bound to a table called tbl_Department_Employee
There is another text field in the table called Active. This field says
either "yes" or "no." I want only the active responsible parties to appear.
I have the three fields in the SQL statement of the Row Source of Responsible
Party on the form. In the acive criteria I have "yes." When I run the sql
statement only the entries set to "yes" appear. However, when I go back to
the form they are all still appearing.
I do have this code in the After Update Event of the Department field in the
form:

On Error Resume Next
ResponsibleParty.RowSource = "Select tbl_Department_Employee.
ResponsibleParty " & _
"FROM tbl_Department_Employee " & _
"WHERE tbl_Department_Employee.Department = '" & Department.Value
& "' " & _
"ORDER BY tbl_Department_Employee.ResponsibleParty;"

Can someone help me make the resp party entries not appear if they are not
active?
Show full article (1.08Kb)
4 Comments
1 2 3 4 5 6 7 8 9