Topics Search

StLinkCriteria - 2 fields

StLinkCriteria - 2 fields
Views: 202
I'm building an Event at Access to visualize a report (called Carttoes) linked to the data of two fields: [codigorodada] and [caixas].
I only know how to set the linking criteria for one field, how could I put the StLinkCriteria for both fields? ...
Sponsored Links:

Similar posts...

 

Select record in list box and open form populated with that record

Select record in list box and open form populated with that record Icon
For search form, n list box to filter the record. What I really want is to double click the highlighted record to display full record which in other form.

Dim stDocName As String Dim stLinkCriteria As String
stDocName = "USER"
stLinkCriteria = "[Service Tag]=" & Me![search]
DoCmd.OpenForm stDocName, , , stLinkCriteria

However, the code run to be error at stLinkCriteria. I don't know how to configure the problem since I just copied the code from my research. or do I have another way so I can display the selected record from listbox.
 

Opening report with VBA code, but opens maximized behind other open forms

Opening report with VBA code, but opens maximized behind other open forms Icon
I'm trying to open a report from a Button on a form, but when the report opens it hides behind the other forms on-screen, meaning you have to go to Window and then select it to bring it forward.

Here's the code I'm using in the on-click event of the first form:

Private Sub btnPrint_Click() On Error GoTo Err_btnPrint_Click
Dim stDocName As String, vResult As Integer
Dim vOption As Integer, vNow As String
vOption = opt1
If opt1 = 1 Then stLinkCriteria = "" Else stLinkCriteria = "[ReBadge]= TRUE"
If cmbBadgeType = "Delegate" Then
DoCmd.OpenReport "rptBadgesDelegates", acViewPreview, , stLinkCriteria
Else
DoCmd.OpenReport "rptBadgesAll", acViewPreview, , stLinkCriteria
End If
DoCmd.Close acForm, Me.Name
 

OpenForm action cancelled

OpenForm action cancelled Icon
in my database, I have a form button that receives the error "OpenForm action was cancelled". I could use some help on how to fix, below is the VBA code used for the button.

Private Sub cmdAddUwriter_Click()
On Error GoTo Err_cmdAddUwriter_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmUWriter"

stLinkCriteria = "[ClientNo]=" & Me![ClientNo]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdAddUwriter_Click:
Exit Sub
Err_cmdAddUwriter_Click:
MsgBox Err.Description
Resume Exit_cmdAddUwriter_Click
 

Filter string: between dates

Filter string: between dates Icon
I am passing a string to a docmd.openform that has the filter string in it

Start = Format(Text205.Text, "dd/mm/yy", vbMonday)
EndD = Format(Text208.Value, "dd/mm/yy", vbMonday)
If stLinkCriteria = "" Then
stLinkCriteria = "[Input Date] BETWEEN " & Start & " AND " & EndD

Ihave stepped through it and the string looks fine to me with the data filled in

I tried filtering the query it's based on directly using the same dates and it works

All I get at the minute is a blank report or a report with all entries (depending on what I have changed in the code to try get it to work)

Help me before I go insane, please please please
 

Report_Grouping

Report_Grouping Icon
I have a report with many fields from one table. Six of the fields are memo fields that can grow. I am trying to add a grouping to each of the memo fields so that I can force a new page and / or keep together.

The memo fields are not showing on the field/expression dropdown. They are valid fields and are present in the field listing.

Do I have too many other fields? Is there a limit? Can you not sort/group on memo fields?

I tried having each of the memo fields as a subreport, but that does not work either.
 

No. of fields in a table

No. of fields in a table Icon
I know that the maximum number of fields in a table is 255. I have one table which is now at 211 fields and I am wondering whether this many fields affects performance. Should I separateinto separate tables with a one to one relationship?

There are no repeating fields.
 

Splitting report fields up if you have too many

Splitting report fields up if you have too many Icon
What is a best fix for this. I have a report[Landscape] with about 20 fields all lined up horizontally side by side. In report view I see all fields with all data.I have to use horizontal scrolls to see all fields though.

In print view I only see just a couple of fields, the rest of fields appear on different pages--I horizontally scroll to see them. I have manually adjustedto get the most number of fields to fit a page but it just wont fit.

It is possible to snake the reports in such a way that.I will have it look like below;
 

5 Fields Multiple Values

5 Fields Multiple Values Icon
I have five fields that can contain either 1 or 0. Let's call them Fields A, B, C, D, E.

I need to write a query that will select them if any of the Fields A-E = 0.
Is there a better way than placing all variations of the five ones and zeros in the Criteria area of the query?
 

Calculated fields as criteria

Calculated fields as criteria Icon
I've created a query that finds the last non-zero field in a series of fields and captures the year and amount in calculated fields. I've defined the fields in the calcs by wrapping the expressions in CDbl().

When I try to use the calc fields as select criteria, however, my calculations break down, do youthink?
 

Cannot enter data in fields on my form...

Cannot enter data in fields on my form... Icon
Cannot enter data in fields on my form.

I have quite a few fields which are lookups to other tables and then there are a few queries as well

I can't change or edit any fields on this form. Do I need to create a master query with all the relevant fields and use it as the Forms main Record Source?