You don't need to have multiple variables declared. You can use a single variable.
Dim PD As String
PD = PD & Nz(rs.Fields(x).Value, vbNullString)
The Nz function handles nulls and turns them into empty strings so if there isn't anything there, it won't show up.
Your problem appears to be that you have your
.MoveNext
in the wrong place.
You have:
With rst
OID = rst!OrderID
Do Until .EOF
If OID = rst!OrderID Then
.Edit
!OrderLineNumber = i
.Update
.MoveNext
i = i + 1
Else...
Your description is kind of confusing. Can you post a screenshot of what you have and what you expect? You can do so before 10 posts if you zip the file before uploading.
You should NOT use a new connection for this. instead of
Set cnn As New AODB.Connection
it should be
Set cnn = CurrentProject.Connection
otherwise you can end up with errors.
What version of Access are you using? Access 2013 doesn't support dbf files directly anymore. You can try doing this:
Open the .dbf file in Excel and resave it as a .csv file and then import from that.
If you have any of them with their ALLOW ADDITIONS property set to NO and there are no records in that subform for the selected record on the main form, it will disappear.
You were simply missing a Row Source for your Combo box and then setting the Column Count to 2 and widths to 0";1" (or use equivalent cm if applicable).
See revised version.
It would appear that your PK is text which then the code should be:
Dim strCrit As String
strCrit = "PkID=" & Chr(34) & Me.RadStocks & Chr(34)
DoCmd.OpenForm "frmIssueRadItems", , , strCrit
The Chr(34) is a double quote but it is easier to look at and remember instead of needing to...
I don't think I would say that any version has been as stable as A97. Personally, I think you would be good to go with Access 2010. 2003 is approaching full end of life in April 2014. 2007 is buggy and has a lot of annoyances. 2010 fixed a lot of what was wrong with 2007. 2013 is not as...
Have you tried just one field alias first to verify that it won't work at all? The reason I ask is that you have [Date] in there and that can possibly be the culprit. Can you do it if you only use
Select ID, PONum As [PO Number]
I'm going to disagree on your choice of words MikeLeBen. It is not an executable only version. It does keep forms, reports, and modules from being modified. However, tables, queries, and macros can still be modified in an ACCDE (and MDE).
The Row Source of the combo box should ONLY contain the id/values from the lookup table. It should have no association with the form (except possibly to have criteria referring to that form). The form's record set should be where the selections, inputs are saved. But the row source of the...
DoCmd.Save only saves object STRUCTURE. It has nothing to do with records. If you are in code and want to save the record currently being worked on you can use
If Me.Dirty Then Me.Dirty = False
to force a save. Checking to see if there have been changes (dirty) first ensures you don't...
I can't remember what it was but I swear that I saw an example one time either at an MVP Summit or MS Development Kitchen event that they demonstrated a way to get that via a macro. But for the life of me I just can't remember but vague shadows about it. So, I may be wrong.
1. Are you on SP3 of Access? I have SP2.
2. Check your Zip Utility and make sure that it is NOT set to Maximum Compression. I"ve seen that cause problems before. Just set to Normal Compression.
You can change it in the QBE grid by simply changing the drop down that says
GROUP BY
under the field to
WHERE
That will remove the X from the SHOW for showing the field, so If you need the field to be included just add the field again but without the criteria and leave the Group By in...